View State

Status
Not open for further replies.

Tamer_Ahmed

Centurion
Joined
Dec 20, 2003
Messages
159
Location
Egypt
hi every one i have a login page if the user enter wrong password he will find text on label saying Wrong Password and the user will try again but this time with the real password he will move to another page the problem is here is he press Back Button from the Browser's toolbar to login with another user and password he will find the label still contain the text "Wrong Password" i made enabel view state = False but still not work anybody can help
 
it's not gone work coz the last state for the label where visible = True and i can't write it in the page load coz i retur to page with Back Button from the browser is Toolbar
 
When you hit BACK in the browser... I think the page is loaded from cached. So... the solution is to make this lable invisible after you confirmed the password like right after.

Like this... the label won't be visible when you hit BACK (didn't try it... so it's only a supposition)
 
it's gone work but if the user hit back to login with another user and password and enter invalid user and password the label's not visible now he's not gone know what's the wrong with his login information
 
In the page_load event try putting
Visual Basic:
Response.Cache.SetCacheability(HttpCacheability.NoCache)
this should prevent the browser from caching that particular page.
 
Thanks PlausiblyDamp this code is work i have another Question can i prevent all the application from being cached not particular page all pages
 
Status
Not open for further replies.
Back
Top