views:

1380

answers:

4

Dear Techies

I have an ASP.NET web application where i am having multiple subrirectories in the root folder.in my root web.config, i have sessionMode as "StateServer" . So in one page of my subdirectory, i am not able to do serialization. If i change the SessionMode method to "InProc" , it will work fine. I want to maintain the web.config file in the root directory as it is.So i am planning about having another web.config file in sub directory.Can anyone tell me how to do this ?

Thanks in advance

+1  A: 

You can just place a new web.config file in the sub-directory and ASP.NET will override any settings you change in that directory.

Adam Pope
+3  A: 

If you mark the class that is being put in the Session with the [Serializable] attribute, it can usually be used in an StateServer setup.

iZ
A: 

Just put another web.config in the subdirectory. ASP.NET allows for that, and I have several areas on my website where the web.config contains values specifically for that "application" specifically.

That said:

1) Are you sure it's a good idea to maintain state in two different ways? It would probably be better to figure out how to make your session state serializable or get rid of using session state altogether.

2) All those web.config files can get tough to maintain if you're not careful about what values you put in each.

Telos
A: 
khatrah