Social Icons

Friday, 21 June 2013

PageViews Count Example using Viewstate in Asp.net

PageViewsCount Example Using ViewState:

Introduction:

In my previous articles i explained various concepts on WPF,Asp.Net and Ajax.Now i will explain pageviewscount example using ViewState in Asp.Net. You can find full details regarding ViewState here.

Description:

ViewState:

It is the process of tracking the values of the controls on the page for multiple requests for the same page.
In this example we will calculate total postback count on that page. For this take two labels and a button on the page. Page looks like below


 In the form load event write like this


 For every button click event postback occurs and then displays the postback count in the label.

ViewState Postback count example

Conclusion:

I hope you got an idea on how read and write values to and from viewstate in asp.net.

Related Tutorials

 

 

1 comment:

Please Give your Valuable Suggestions,Questions and Comments to improve my blog.