Pages EnableViewState

Posted by Jayakumars under ASP.NET AJAX on 3/28/2013 | Points: 10 | Views : 1161 | Status : [Member] [MVP] | Replies : 3
hi

we are normally assign session value like this

Viewstate["empid"]=100;



so why we are put like this code

< Pages EnableViewState="false" / >

or
< Pages EnableViewState="true" / >

Mark as Answer if its helpful to you


Responses

Posted by: Jitendrasoft09 on: 3/28/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Viewstate["empid"]=100 - To be used when you need to transfer the same data within the page.

< Pages EnableViewState="false" / >
or
< Pages EnableViewState="true" / >

Above code are page level viewstate to enabled the true or false on page side not control side of the page.



Jitendra Kumar
If my post helps you, plz mark as an answer.

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 3/28/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Jitendrasoft09

page level means we are access whole project in viewstate?

Normally we are set viewstate we are access current page right can u ask elaborate for this?

Mark as Answer if its helpful to you

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jitendrasoft09 on: 3/28/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi Jay,

Page level means we are acessing the particular web page not whole project, if we need to create whole project need to set in web.config file.

Viewstate["empid"]=100; - like you have written this code, so if you are doing EnabledViewState false in the page, it will not transfer the empid value.



Jitendra Kumar
If my post helps you, plz mark as an answer.

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response