User Controls not working if I put Validation controls in user control

Hi

          I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed.

0
srijyothi
11/2/2007 9:57:26 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 5 followers.

💬 3 Replies
👁️‍🗨️ 1034 Views

In the Validation controls, make sure you are setting the ControlToValidate property to the control that it links to.

 If you're in .NET 2.0, it's also a good idea to put all the validation controls in the same ValidationGroup as the control that triggers the postback.

0
ChrisR
11/2/2007 10:23:50 PM

srijyothi:

          I have validation controls(RequiredField Validator,RegularExpressionValidator)  in user controls.User controls are not posting back like the events are not wiring up.If I remove Validation controls in User controls page,user controls are working fine.Can anyone please help me out in getting it fixed.

Hi srijyothi,

Base on my experience,  it maybe cause of regular expression.

For example, the regular expression need the client user type an e-mail, but the client user do not type an e-mail, so it can not pass the page validation.

 

Please correct me if I have misunderstood your mean, please LET ME KNOW, Thanks, 

Hope it helps,

Hong Gang

 


Hong-Gang Chen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hong
11/7/2007 2:01:08 AM

Hi,
Hope this previous link helps u.....
http://forums.asp.net/p/868938/1863889.aspx

if not try with javascript validations in Usercontrol like this....
http://www.codeproject.com/aspnet/Javascript_in_Usercontrol.asp
http://msdn2.microsoft.com/en-us/library/aa478956.aspx


Mark as "Answered" if this post is helpful...................

Thanks and Regards
Amar
1
amar
11/7/2007 8:04:37 AM
Reply: