Search code examples
asp.netasp.net-mvcsessionsession-state

Do I need to track Session State in an MVC app if I include an ASPX file or usercontrol?


I have a MVC site that will be using an ASPX control that probably used session state (though I'm unsure)

Should I use something to track session state in my MVC application to keep the stateless operation, or is there a different technique I should use?

Is the new Microsoft Universal Provider a good idea to use?


Solution

  • I have a MVC site that will be using an ASPX control

    Using server side controls possibly relying on viewstate and postback models is not recommended in an ASP.NET MVC application. You are in an unknown territory here. Depending on the server control you are trying to use and its dependency on notions that no longer exist in ASP.NET MVC you will have more or less success with this. But in any case you will end up with an application in contradiction with the MVC pattern.

    As far as sessions are concerned, they are supported in ASP.NET MVC and if your server side control relies on them, they are enabled by default so there should not be any problem with them.