Validator
-
Hi, I am looking for suggestions on validation on a page and usercontrol. I have a webpage test.aspx and a use control UserControl.ascx. Test.aspx txtName (textbox) rfvCheckName (RequiredFieldValidator to check txtName) btnSubmitName (button) UserControl.ascx txtTel (textbox) rfvCheckTel (RequiredFieldValidator to check txtTel) btnSubmitTel (button) Now, the required RequiredFieldValidator (RFV) works fine for the aspx and ascx. However, When I add the usercontrol into the test.aspx, a problem occurs: txtName (test.aspx) is empty txtTel (usercontrol.ascx) has input, When I click on the btnSubmitTel (usercontrol.ascx), it activates the rfvCheckName (test.aspx)! How can I force each button to activate only certain RFV? (If its possible at all) Or is there any work around to this? Thanks
-
Hi, I am looking for suggestions on validation on a page and usercontrol. I have a webpage test.aspx and a use control UserControl.ascx. Test.aspx txtName (textbox) rfvCheckName (RequiredFieldValidator to check txtName) btnSubmitName (button) UserControl.ascx txtTel (textbox) rfvCheckTel (RequiredFieldValidator to check txtTel) btnSubmitTel (button) Now, the required RequiredFieldValidator (RFV) works fine for the aspx and ascx. However, When I add the usercontrol into the test.aspx, a problem occurs: txtName (test.aspx) is empty txtTel (usercontrol.ascx) has input, When I click on the btnSubmitTel (usercontrol.ascx), it activates the rfvCheckName (test.aspx)! How can I force each button to activate only certain RFV? (If its possible at all) Or is there any work around to this? Thanks
Hi, You can not activate the certain Validator on click of button but u can set CauseValidation property of button to False to by pass the Validation.... Regards, Ritesh
-
Hi, You can not activate the certain Validator on click of button but u can set CauseValidation property of button to False to by pass the Validation.... Regards, Ritesh
Hi, I know and tried that. But the problem is that if I set the CauseValidation of the UserControl's button to false, then it won't activate the RFV inside the usercontrol. Dilemma!
-
Hi, I know and tried that. But the problem is that if I set the CauseValidation of the UserControl's button to false, then it won't activate the RFV inside the usercontrol. Dilemma!
Then Why don't u go for java script instead of using Validation Controls! "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."
-
Then Why don't u go for java script instead of using Validation Controls! "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."
is that the only way out?
-
is that the only way out?
If u want to use only validation controls and doesn't want to use Javascript then u can do that using Frame work 2.0 It's a limitation in 1.1 since validation groups are not available in 1.1 "Every morning I check Forbes 40 richest Indians list , if i'm not there I go to work."