Link to home
Start Free TrialLog in
Avatar of steve_mick972
steve_mick972

asked on

Events in 2 User Controls.

Here's my situation:

 I have a page ( Index.aspx), here i have 2 place holders and i have two different user controls. call them: uc1 and uc2 ( user control)

 Both these user controls have textboxes, and a submit button.

 Here is what i want to do:

 if uc1 button is clicked, i want to check if uc2 textboxes are filled first and call the submit button of the uc2 control -
 and then do a uc1 button click. I am trying to check if the user has login information in the uc2 control and then do a some button click on the uc1 control.

 the same way - if the user has some text information in the textboxes of uc1 and they click on the uc2 submit button - i want
to first finish uc2 button click and only then do a uc1 button submit.

By the way: there are some bussiness logic in each of these button submits.

 I am trying to combine the two on a page level and process both if some information is entered in either of the controls.

I know this has to be done using some bubbling of events, but dont know how to proceed.

Should i create a separate class to handle this, or just do it on the page..


Gurus, Any help is appreciated.


Thanks in advance.
Avatar of mmarinov
mmarinov

Hi steve_mick972,

i suggest you to create the handler of both button to call same subroutine and pass as parameter to it the button
then in this subroutine you will know which button was hit and do what you want

for validating, you can out requiredfieldvalidators and just use Page.Validate

Regards!
B..M
mmarinov
ASKER CERTIFIED SOLUTION
Avatar of CJ_S
CJ_S
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial