Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
4.00/5 (3 votes)
See more:
Hi All,

I set enableviewstate property to false in page directive.

I just run the application and entered some text in textbox control and clicked button.

The page is postbacked and the text entered in textbox persists.

Why this happens even the view state is disabled?

Can you help me to solve this,

Thanks in Advance.
Posted
Updated 5-Jun-11 21:33pm
v2

 
Share this answer
 
Comments
gowthammanju 6-Jun-11 3:45am    
ya, thanks
Sandesh M Patil 6-Jun-11 5:19am    
nice answer
add
VB
if (ispostback=false)then
'your code
end if

on your page load
but first look on the properties of your textbox if autopostback = true
 
Share this answer
 
Comments
chaosgray 6-Jun-11 4:27am    
good point. :)
because thats the heirarchy
1. Page Request
2. Start
4. Initializes
4. Pageload
5. PostBack
6. Render
7. Unload
 
Share this answer
 
Comments
gowthammanju 6-Jun-11 3:45am    
ya,thanks
you should use databind.

try this link.
[1]
[2]


hope it helps.
goodluck. :)


-chaosgray-
 
Share this answer
 
Comments
gowthammanju 6-Jun-11 3:44am    
ya, thanks
chaosgray 6-Jun-11 4:20am    
no problem, just approve this answer. :)
I don't think TextBox's Text property has anything to do with ViewState(being enabled or disabled). I believe it is part of form data not ViewState.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900