Showing posts with label Framework. Show all posts
Showing posts with label Framework. Show all posts

What namespaces are imported by default in ASPX files

The following namespaces are imported by default. Other namespaces must be imported manually using @ Import directives.
· System
· System.Collections
· System.Collections.Specialized
· System.Configuration
· System.Text
· System.Text.RegularExpressions
· System.Web
· System.Web.Caching
· System.Web.Security
· System.Web.SessionState
· System.Web.UI
· System.Web.UI.HtmlControls System.Web.UI.WebControls

ViewState

Each control on a Web Forms page, including the page itself, has a ViewState property that it inherits from the base Control class. View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.
You can use the ViewState property to save your values independent of control state between round trips to the server. The ViewState property is stored in the page in a hidden form field

Difference Between ViewState and SessionState

ViewState persist the values of controls of particular page in the client (browser) when post back operation done. When user requests another page previous page data no longer available.

SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes.