Tamer_Ahmed Posted May 12, 2004 Posted May 12, 2004 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
Arch4ngel Posted May 12, 2004 Posted May 12, 2004 ViewState isn't used for this. If you want to hide it... make it invisible. Label1.Visible = false "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Tamer_Ahmed Posted May 12, 2004 Author Posted May 12, 2004 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
Arch4ngel Posted May 12, 2004 Posted May 12, 2004 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) "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Tamer_Ahmed Posted May 12, 2004 Author Posted May 12, 2004 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
Administrators PlausiblyDamp Posted May 12, 2004 Administrators Posted May 12, 2004 In the page_load event try putting Response.Cache.SetCacheability(HttpCacheability.NoCache) this should prevent the browser from caching that particular page. Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Tamer_Ahmed Posted May 12, 2004 Author Posted May 12, 2004 Thanks PlausiblyDamp this code is work i have another Question can i prevent all the application from being cached not particular page all pages
Recommended Posts