Groups | Blog | Home
all groups > c# > november 2004 >

c# : event bubble


Anders Borum
11/30/2004 1:05:26 PM
Please post asp.net related questions to
microsoft.public.dotnet.framework.aspnet

--
venlig hilsen / with regards
anders borum
--

Jon Skeet [C# MVP]
11/30/2004 1:46:16 PM
[quoted text, click to view]

I'm sure it won't if you make a good request (eg with full sample
code).

[quoted text, click to view]

Just because you're using C# doesn't mean that it's a question *about*
C#.

This is twice in two days that you've been rude in a response. Are you
always like this with people who are trying to help you? If you keep
going like this, you're unlikely to get *any* help after a while. Why
would anyone want to respond to you if you're just going to be rude
back?

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
Anders Borum
11/30/2004 2:38:57 PM
Hello!

[quoted text, click to view]

No. Microsoft obviously created the different newsgroups just for fun with
no real intention of grouping related technologies (phun intended).

[quoted text, click to view]

I would be careful about talking to other people like that. Especially when
you're in a position asking for help.

--
venlig hilsen / with regards
anders borum
--

Tom Gao
11/30/2004 10:37:09 PM
Hello friends

I'm trying to perform event bubble on a user control from the example on
http://odetocode.com/Articles/94.aspx

but this example doesn't work... when I run the code it says BubbleControl
does not exist which makes sense as nothing was assigned to BubbleControl...
I'm just curious if I should assign because I did try assigning
BubbleControl with a new instance but still it did not assign the event to
BubbleControl.BubbleClick on the user control side.

Just wondering if anyone know how to do this.

Thanks
Tom

public class WebForm1 : System.Web.UI.Page
{
protected WebUserControl1 BubbleControl;

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("WebForm1 :: Page_Load <BR>");
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
BubbleControl.BubbleClick += new EventHandler(WebForm1_BubbleClick);
}
#endregion

private void WebForm1_BubbleClick(object sender, EventArgs e)
{
Response.Write("WebForm1 :: WebForm1_BubbleClick from " +
sender.GetType().ToString() + "<BR>");
}
}####### control public class WebUserControl1 : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Panel Panel1;

private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("WebUserControl1 :: Page_Load <BR>");
}

private void Button1_Click(object sender, System.EventArgs e)
{
Response.Write("WebUserControl1 :: Begin Button1_Click <BR>");
OnBubbleClick(e);
Response.Write("WebUserControl1 :: End Button1_Click <BR>");
}

public event EventHandler BubbleClick;

protected void OnBubbleClick(EventArgs e)
{
if(BubbleClick != null)
{
BubbleClick(this, e);
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

}

Tom Gao
11/30/2004 11:29:26 PM
errr... why ?

it would take me 1 week to get a response there ?

whats the difference anyway ? this is C# and I'm using C#

Thanks
Tom

[quoted text, click to view]

Tom Gao
11/30/2004 11:31:41 PM
if you got the time why don't you answer my question ? does it matter where
I post ?

I think you're wasting my post thread

so please go annoy someone else

[quoted text, click to view]

AddThis Social Bookmark Button