Malaika Consultants LLC

Step 5: ASP.NET View-State

by Jane Thomson 1. May 2011 23:31

After learning a web form and few of the ASP.NET controls, let us look at one of the prime feature of ASP.Net known as View-State. If you have been as ASP developer, you must know that once you submit the form, all the values from the form are cleared. Now, suppose the server comes up with error! Haah, that’s really a bad situation for user and has to refill all the information on the form, and that’s something you want to avoid as a developer.

ASP.NET View-State feature provides exactly the same. As a user if you find that the value you submitted still remains there even if the server gives an error and you press back button, think blindly that the web page is developed with ASP.NET View-State feature.

Basically, ASP.NET View-State is a method used by the ASP.NET pages to persevere the changes of state of a web form across the postbacks. Actual thing is that the ASP.NET maintains the view-state of your form. View-State defines the value of the web page at the time of submission to server. The current status of the web form is maintained with a hidden element places on each of the page with a form control.

It’s a default setting of ASP.NET to maintain the View-State of ASP.NET. In case, if you do not want to maintain a View-State of a web form, you shall include directive, <%@ Page EnableViewState="false" %> on top of the web form. Or else you can also add the element EnableViewState = “false” to any of the controls on the page.

A developer shall use ASP.NET View-State if he/she wants to achieve one of the below features in web page:

·         Save the form values between postbacks even without saving it in a user profile.

·         Save page control property values defined by a developer.

·         If a developer wants to store the view-state information in any data storage.


For Step 6 please click here.

 


Tags:

Comments

5/1/2011 11:33:18 PM #

Step 4: ASP.NET Master Pages

Step 4: ASP.NET Master Pages

Malaika Consultants LLC | Reply

6/4/2011 8:13:34 PM #

very good article... it was said good

link United States | Reply

6/9/2011 12:36:47 AM #

Very cool blog, thank you very much for making the time in writing this information.

Surveillance Master United States | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



::: | © Malaika Consultants LLC | :::

Malaika Consultants LLC

Malaika Consultants LLC is a custom software development consulting firm located in Cary (Raleigh Durham Research Triangle AKA RTP area ) North Carolina. We offer our expert consulting services in the Microsoft .NET and related technologies. Our mission is to partner with you and ensure the success of your project. We have a team in the USA that will help you with your Information Technology needs and we strive to be truly "Your Information Technology Angels"

We are offering 1 hour of free consulting -- ASP.NET, SQL Server, IIS, anything. Contact us to get your free consulting

Recent Comments

Comment RSS