|
-
Sep 22nd, 2008, 09:50 PM
#1
Thread Starter
Fanatic Member
validation on a user control when clicking a button on different user control
Hi,
I am maintaining page where a user control is initialized dynamically.
The user control UC1 has a customvalidator using server side validation. When the postback is caused by a button inside the user control UC1 causes the postback, the customvalidator works fine and I get my validation results displayed. However, If I click a button located on a second user control UC2 on the main aspx page, the validation doesn t execute and I get no result validation error displayed.
My question,
how can I make the validation execute on the user control UC1 when the postback is caused by a button located in another user control UC2 on the main page? and how can I get the user control UC1 display the validation error message?
p.s: Notice that I am using customvalidator on server side, not on client side
Thanks a lot for your help.
-
Sep 24th, 2008, 03:03 AM
#2
Re: validation on a user control when clicking a button on different user control
I am not 100% certain but based on my experience with validators across different controls on the same page, you can't get the validators in one control to fire from a page or another control. Instead, I have had to place a custom validator control on the page with a server side method, which in turn called a property of the 'other' control which in turn checked to see if the input in it was valid or not!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|