Labels

slider

Recent

Navigation

State Management in ASP.net

State Management in ASP.net, state management in mvc, state management techniques in asp.net, state management

Introduction

Today State management have vital role to play maintain state in ASP.net. HTTP protocol is stateless and it can’t be save/preserve the information so it is brilliant requirement to maintain states on client side as well server side. Ever changing in technology  these days we have to follow some ideal techniques to maintain the states client side because when ASP.Net server disconnects from server then information are saved in ASP.net controls called states. I have suggested below some good techniques to maintain state management in ASP.Net.
State Management in ASP.net
State Management in ASP.net

Client Based State Management options

1. View state: We can maintain view state in ASP.net when render event is fired and now page can save the information & disconnected from the server. View state life cycle is only one page we can’t navigate the information to other page with help of view state technique.

ViewState["Technology_Crowds_Year"] = "2013";

2. Control state: Control state is also maintained to preserve the state management in ASP.net but it can be possible only when we have enable view state is true otherwise it is not able to maintain state in asp.net

3. Hidden fields: Hidden field s are very good technique to maintain state in client side, hidden fields works likes repository  to save information In client side.

<asp:HiddenField id="hdTechnologyCrowds" runat="server" value='<%= Request.QueryString["TechID"] %>' />

Namespace: System.Web.UI.WebControls.HiddenField
Assembly: System.Web (System.Web.dll)

4. Cookies: Cookies is also used to maintain information at client side we can set life of cookies with expiration date as per our requirement.

5. Query strings: Query string is also good techniques to maintain state at the client side, Query string life cycle is from one page to next one only.
Example: www.technologycrowds.com/default.aspx?it =10
Querystring is most weak state in ASP.net so don’t rely on it mostly because it can be tampered very easily.

Server Based State Management options

1. Application state:  This is very brilliant technique to maintain state in ASP.Net, we can share information globally through application state & can use also this state throughout the application. It have brilliant features to track application start, application end etc.

2. Session state: This technique is most ideal technique to maintain state management in ASP.net, When any user open the browser & after authorization login then a new session is started & always different from other users. It is very good technique to track multiple browser session & multiple users.

3. Profile Properties: Profile properties is also ideal technique to maintain state in asp.net, profile properties is maintained until the session is preserves in the browser, we can store the information related to particular user & can user on all pages under user authorization.

Suggested Reading

Share

Anjan kant

Outstanding journey in Microsoft Technologies (ASP.Net, C#, SQL Programming, WPF, Silverlight, WCF etc.), client side technologies AngularJS, KnockoutJS, Javascript, Ajax Calls, Json and Hybrid apps etc. I love to devote free time in writing, blogging, social networking and adventurous life

Post A Comment:

0 comments: