Session State 2 Webprojects

  • Thread starter Thread starter Arun
  • Start date Start date
A

Arun

Hi,

Is it possible to share Session/Application State across different Asp.net
webapplication (one in VB.net )
and the other is C# ?

If so can you guide me ?

-Regards'
Arun
 
What is your scenario ? By definition, an application is supposed to deal
with its own set of variables.

Patrice
 
Hi,
I have one application in VB.net and other one in C#.

Whenever I try to through a link navigate the pages from Vb.net to C# I
lose the session control.

Hope you understand what I am trying to convey.

-Thanks
Arun
 
Hummmm, I see technically the problem but I don't understand what you need
to share (all variables ?).

Actually it looks like to me there is a design problem. What you describe
looks like a single application that is for some reason broken into two
different parts.

If this is really two distinct applications, I don't see why you would want
to share *all* variables. You could however :
- implement single sign on (so that you have to log once)
- consume some results from one from the other (web service perhaps)
- pass for some reason a speicif information from one to the other

Are they usable each one alone or are those VB.NET pages making sense only
when used with C# pages ?

Patrice
 
It's not two distinct application.

Initially we started in VB.net and later when we found experienced guy in c#
we
moved to C#.

The problem is some of the master files are in VB.net and for the users it
definitely needs to shown
from C# pages.

RIGHT now don't have time to convert vb.net files to C#.

That's the scenario.

Bye
Arun
 
For now using both C# and VB.NET in a single project is AFAIK not supported
in VS.NET (supported in VS.NET 2005 ?)

My approach would rather to make this a single application.

I believe that you should be able to create a batch file that calls the
VB.NET compiler to create a DLL from all the VB.NET code-behind files.
Similarly, you'll call also the C# compiler to create a DLL that includes
the code behind for the C# pages.

Now put those two DLLs in your app bin directory, and all your pages under
the same tree. You should have now a single application that uses these two
DLLs.

For now, I'm using something similar to build distincts DLLs (this is an
intranet application, compiling the code-behind in multiple DLLs allows us
to update a module on our production server while others are still under
revision). I would say it should work as well for VB.NET and C# code behind
files (as it doesn't matter once they are compiled into a DLL).

The other approch would be to pass back and forth values between the two
applications. Basically :
- either you can drop session state (using a db for example) but you'll have
to update the code, depnds how much you rely on state variables
- you could certainly have a way to pass value back and worth (such as a
wrapper that post the new session value to the other session each time you
change a session or a variable)
- you'll have possibly to handle single sign on issue and to handle the
correspondance between the two sessions running for each single user on both
servers.

All in all it's likely more work and would be much more error prone (and
would become useless if VS.NET 2005 improves this as it looks to be the case
with the MsBuild feature).

Good luck.

Patrice
 
Back
Top