|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
howto: bubble-up eventsHello:
using Vb.net .. I have an asp.net web page: home.aspx, with a placeholder that loads Inspections.ascx UserCategories.aspx has a button MySubmit that submits information: what I want is some code that I would place in home.aspx that would detect that MySubmit was clicked and get the name of the button (in this case, MySubmit) Is there a way to do this ? Thanks Terry Yep. Add an event to your usercontrol and then in the UC's click event handler
for the button, raise the event: class MyUC { public event EventHandler MySubmit; private void Button1_Click() { if (MySubmit != null) MySubmit(this, EventArgs.Empty); } } The in the page, just handle the OnMySubmit like you'd handle any event from any other control. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hello: > using Vb.net .. > I have an asp.net web page: home.aspx, with a placeholder that loads > Inspections.ascx > UserCategories.aspx has a button MySubmit that submits information: > what I want is some code that I would place in home.aspx that would > detect > that MySubmit was clicked and get the name of the button (in this > case, > MySubmit) > Is there a way to do this ? > Thanks > Terry thanks - i have to understand the c syntax ...
Terry Show quoteHide quote "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message news:810893632527043445866176@msnews.microsoft.com... > Yep. Add an event to your usercontrol and then in the UC's click event > handler for the button, raise the event: > > class MyUC > { > public event EventHandler MySubmit; > > private void Button1_Click() > { > if (MySubmit != null) MySubmit(this, EventArgs.Empty); > } > } > > The in the page, just handle the OnMySubmit like you'd handle any event > from any other control. > > -Brock > DevelopMentor > http://staff.develop.com/ballen > > > >> Hello: >> using Vb.net .. >> I have an asp.net web page: home.aspx, with a placeholder that loads >> Inspections.ascx >> UserCategories.aspx has a button MySubmit that submits information: >> what I want is some code that I would place in home.aspx that would >> detect >> that MySubmit was clicked and get the name of the button (in this >> case, >> MySubmit) >> Is there a way to do this ? >> Thanks >> Terry > > >
DATASET DATAGRID ITEMINDEX DATASETINDEX
How can I get selected Checklistbox Items to Literal in Placeholde FindControl by type? ASP.NET Tree View Control Problems with HTMLInputFile Control Type.GetType("System.Web.UI....) Web server controls not shown on a web form Datagrid Listbox please help Problem using Response.Redirect from a User Control Which is better User Control or Frame? |
|||||||||||||||||||||||