By default, Asp.Net MVC support session state. Session is used to store data values across requests. Whether you store some data values with in the session or not Asp.Net MVC must manage the session state for all the controllers in your application that is time consuming. Since, session is stored on server side and consumes server memory, hence it also affect your application performance.
If some of the controllers of your Asp.Net MVC application are not using session state features, you can disable session for those controller and can gain slight performance improvement of your application. You can simplify session state for your application by using available options for session state.
In Asp.Net MVC4, SessionState attribute provides you more control over the behavior of session-state by specifying the value of SessionStateBehavior enumeration as shown below:
In Asp.Net MVC, TempData use session state for storing the data values across requests. Hence, when you will disabled the session state for the controller, it will throw the exception as shown below:
I hope you will enjoy the tips while programming with Asp.Net MVC. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.
|
25
JUL
|
ASP.NET MVC with AngularJS Development (online) | ||
|
Mon-Fri (07:30 AM-09:00 AM IST) |
More Details | ||
|
18
JUL
|
AngularJS Development (online) | ||
|
Mon-Fri 08:30 PM-10:30 PM IST |
More Details | ||
|
10
JUL
|
AngularJS Development (offline) | ||
|
Sat,Sun (10:00 AM-12:00 PM IST) |
|||
|
2
JUL
|
ASP.NET MVC with AngularJS Development (offline) | ||
|
Sat, Sun (03:00 PM-05:00 PM IST) |
|||
|
27
JUN
|
ASP.NET MVC with AngularJS Development (online) | ||
|
Mon - Fri (07:00 AM-09:00 AM IST) |
|||
|
13
JUN
|
ASP.NET MVC with AngularJS Development (online) | ||
|
Mon-Fri (08:30 PM-10:30 PM IST) |
|||
|
28
MAY
|
ASP.NET MVC with AngularJS Development (offline) | ||
|
Sat, Sun (05:00 PM-07:00 PM IST) |
|||
|
30
APR
|
NodeJS Development (offline) | ||
|
Sat, Sun (10:00 AM-12:00 PM IST) |
|||