Session State 2 Webprojects

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
 
P

Patrice

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

Patrice
 
A

Arun

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
 
P

Patrice

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
 
A

Arun

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
 
P

Patrice

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top