WebUserControl EventHandlers

M

magister

Hello,

I have a parent page with 2 usercontrols...

parent page has a button

one usercontrol shows a QueryPanel with a textbox, cancel button, and
submit.
it also has 2 EventHandlers Submit & Cancel

second usercontrol has 2 buttons yes & no.

In parent page when the button is clicked the QueryPanel control will
show....when the user clicks submit the QueryPanel disappears....

in the Second User control when the user click the 'No' button the
QueryPanel shows....when the user clicks submit the whole page
forwards with response.redirect...

thus I have in the parent page the following binding in the OnInit

this.QueryScreen1.SubmitQuery += new
System.EventHandler(this.QueryScreen1_SubmitQuery);

this.QueryScreen1.CancelQuery += new
System.EventHandler(this.QueryScreen1_CancelQuery);

&
private void QueryScreen1_SubmitQuery(object sender, EventArgs e)
{
string temp = "";
}

And in the 2nd user control I have the following

((QueryScreen)this.Page.FindControl("QueryScreen1")).SubmitQuery +=
new System.EventHandler(this.QueryScreen1_ForwardSubmitQuery);

((QueryScreen)this.Page.FindControl("QueryScreen1")).CancelQuery +=
new System.EventHandler(this.QueryScreen1_CancelQuery);

private void QueryScreen1_SubmitQuery(object sender, EventArgs e)
{
Response.Redirect("Login.aspx")
}

Does anyone know how I can stop the submit click of the QueryPanel
control to stop doing the parent page event followed by the 2nd user
control event....

How can I wire the Submit button of QueryPanel to a different
eventHandler depending on which WebUserControl or ParentPage button
activated it to start...

Many Thanks,
Shout if you need more code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top