Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > howto: bubble-up events

Reply
Thread Tools

howto: bubble-up events

 
 
Support
Guest
Posts: n/a
 
      05-26-2005
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


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      05-26-2005
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




 
Reply With Quote
 
 
 
 
Support
Guest
Posts: n/a
 
      05-26-2005
thanks - i have to understand the c syntax ...
Terry
"Brock Allen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> 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

>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime events that generate other controls and events newbye ASP .Net 0 07-06-2006 06:27 PM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
order of events - dynamic checkbox events =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= ASP .Net 0 08-17-2005 10:36 PM
Re: passing variables between web page events & httpmodules events Alvin Bruney ASP .Net 1 11-24-2003 04:14 PM
Passing Variables between Web Page Events and HttpModule Events shiv ASP .Net 0 11-21-2003 04:29 PM



Advertisments