Last post Jan 09, 2012 09:52 AM by Galvin
Jan 17, 2010 08:06 AM|mithuntnt|LINK
I have a usercontrol which has few textboxes and associated validators. (This is for holding common form fields which i include at multiple place.)
This usercontrol doesnot have any buttons.
The user control is included inside a page. The page has other textboxes and a submit button.
How do i ensure the the forms in usercontrol is valid when i click the submit button outside on the page?
Thanks and Regards
Parent Page Action
Jan 17, 2010 08:53 AM|Yousef_Jadallah|LINK
If there is a RequiredFieldValidator in the User Control in the page, then then buttons in the main page will fire the validation automatically.
Jan 17, 2010 09:17 AM|deepu.mi|LINK
Write a validation function inside the usercontrol and call that function in other pages..
for ex : Usercontrol page
var isUserControlValidation = validateUserControlls(); //make sure usercontrol validation method calls here
<asp:Button onClientClick="return validatePageControls();" runat="server" Text="Submit">
Hope this helps
Don't forget to “Mark as Answer” on the post, if it helps you
Jan 17, 2010 09:20 AM|amanbhullar|LINK
document.getElementById(<%= textbox1.ClientId %>).value
Jan 17, 2010 01:28 PM|ramiramilu|LINK
According to my knowledge Validation controls in user controls work normally in the asp.net page....
They dont need any special attention....if still want to have specific functionality then use validation group attribute of the button control....
Hope this helps...
Jan 17, 2010 05:58 PM|mithuntnt|LINK
Thanks the problem is solved.
I had put a validation group in the user control. Removing it solved the problem.
Jan 09, 2012 09:52 AM|Galvin|LINK
Thanks working fine