Problem with RequiredFieldValidator
-
Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?
-
Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?
check your asp html file and state itemCommand="resetControl()" as a function you define in your server side code and reset the controls.
-
check your asp html file and state itemCommand="resetControl()" as a function you define in your server side code and reset the controls.
-
Situation: In may Web page I have RequiredFieldValidators. I have button Back. I need that when I push the Back button, page redirects to other page (Response.Redirect("URL")). But its don't work, because of RequiredFieldValidators. I tried: ReqNAME.Enabled = False, but it's doesn't work too...:-(( But when I Disable this validator at all, not in scripting progress in Button_Clik event, its works.... Why it is so? I tried with Button_Click change other validator Properties, no reactions... ?
Have you tried setting the Back buttons CausesValidation property to false? Is it a server control or an html control?
-
Have you tried setting the Back buttons CausesValidation property to false? Is it a server control or an html control?
Thanx! It helps - but why it is so, why I couldn't change validation propertie Enabled to false, using VB.NET? :-( BTW - I use different way (before U solve my problem) - I drop Validations and use Labels with checkin If .. Then... :-) Bt there were many If, so Your solution is better... :-)) Thanx again.
-
Thanx! It helps - but why it is so, why I couldn't change validation propertie Enabled to false, using VB.NET? :-( BTW - I use different way (before U solve my problem) - I drop Validations and use Labels with checkin If .. Then... :-) Bt there were many If, so Your solution is better... :-)) Thanx again.
Glad I could help. If I understand correctly you tried to disable the validation controls in your Back button's click event? This won't work, as validation takes place before this event fires, and your reqNAME.Enabled = False line of code will never be reached. You can disable them in Page_Load, this happens before validation. -Thea-
-
Glad I could help. If I understand correctly you tried to disable the validation controls in your Back button's click event? This won't work, as validation takes place before this event fires, and your reqNAME.Enabled = False line of code will never be reached. You can disable them in Page_Load, this happens before validation. -Thea-