473,624 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

event bubble

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.B ubbleClick on the user control side.

Just wondering if anyone know how to do this.

Thanks
Tom

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

private void Page_Load(objec t sender, System.EventArg s e)
{
Response.Write( "WebForm1 :: Page_Load <BR>");
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);
BubbleControl.B ubbleClick += new EventHandler(We bForm1_BubbleCl ick);
}
#endregion

private void WebForm1_Bubble Click(object sender, EventArgs e)
{
Response.Write( "WebForm1 :: WebForm1_Bubble Click from " +
sender.GetType( ).ToString() + "<BR>");
}
}####### control public class WebUserControl1 : System.Web.UI.U serControl
{
protected System.Web.UI.W ebControls.Butt on Button1;
protected System.Web.UI.W ebControls.Pane l Panel1;

private void Page_Load(objec t sender, System.EventArg s e)
{
Response.Write( "WebUserControl 1 :: Page_Load <BR>");
}

private void Button1_Click(o bject sender, System.EventArg s e)
{
Response.Write( "WebUserControl 1 :: Begin Button1_Click <BR>");
OnBubbleClick(e );
Response.Write( "WebUserControl 1 :: End Button1_Click <BR>");
}

public event EventHandler BubbleClick;

protected void OnBubbleClick(E ventArgs e)
{
if(BubbleClick != null)
{
BubbleClick(thi s, e);
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

}
Nov 16 '05 #1
5 6829
Please post asp.net related questions to
microsoft.publi c.dotnet.framew ork.aspnet

--
venlig hilsen / with regards
anders borum
--
Nov 16 '05 #2
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

"Anders Borum" <an****@spherew orks.dk> wrote in message
news:uP******** ******@TK2MSFTN GP14.phx.gbl...
Please post asp.net related questions to
microsoft.publi c.dotnet.framew ork.aspnet

--
venlig hilsen / with regards
anders borum
--

Nov 16 '05 #3
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

"Anders Borum" <an****@spherew orks.dk> wrote in message
news:uP******** ******@TK2MSFTN GP14.phx.gbl...
Please post asp.net related questions to
microsoft.publi c.dotnet.framew ork.aspnet

--
venlig hilsen / with regards
anders borum
--

Nov 16 '05 #4
Hello!
does it matter where I post ?
No. Microsoft obviously created the different newsgroups just for fun with
no real intention of grouping related technologies (phun intended).
I think you're wasting my post thread

so please go annoy someone else


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
--
Nov 16 '05 #5
Tom Gao <to********@opt ushome.com.au> wrote:
errr... why ?

it would take me 1 week to get a response there ?
I'm sure it won't if you make a good request (eg with full sample
code).
whats the difference anyway ? this is C# and I'm using C#


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 - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11357
by: kj | last post by:
How does one trigger an event programmatically? I'm interested in how to do this in both the "Level 0" event model as well as in the DOM Level 2 event model. Thanks! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded.
2
2374
by: Kirk Is | last post by:
Hi there. I'm trying to improve a simple javascript based graphics editor for Atari 2600 games (long story) with better use of CSS and Javascript. I'm a little weak on what CSS can and can't readily do (sometimes I'm stuck in a Netscape 3 world, mentally) so I have a few questions: Say I had an editor with some CSS like this: <html><head> <style type="text/css"> td.edt {background-color: yellow; height: 50px; width:50px}
10
13914
by: David | last post by:
Is there something that I can use to prevent the a user from dragging something, an image for instance. In IE I can use the ondrag = "return false;", is there a way to achieve the same way with the other browsers? Thanks, David
1
4369
by: Lucifer | last post by:
Hi I am trying to raise a bubble event. I have a dropdownlist and a datalist in a datalist. I want to use the postback from the dropdownlist to rebind the nested datalist. But i need the event to be a datalist Command so i have access to e.item for the main datalist
0
992
by: Nathan Sokalski | last post by:
I am using a DataList with Event Bubbling. When I bubble an event, the ItemCommand event is always called before the bubble event specified in the CommandName property. Is this ASP.NET's way of making ItemCommand the default bubble event, or is there another reason for it? I always thought the purpose of ItemCommand was to use for a purpose other than cancelling, deleting, editing, or updating an item, but it does not seem like that was...
17
10186
by: dan_williams | last post by:
I have the following test web page:- <html> <head><title>Test</title> <script language="Javascript"> <!-- function fnTR() { alert("TR"); }
0
1068
by: shapper | last post by:
Hello, I have a few custom controls organized as follows: Parent Child Section User User control raises an event named Updated. This event has custom arguments of type UpdatedEventArgs.
6
2509
by: Jeremy | last post by:
I've got a floating div which becomes visible when a link is clicked. I want the div to be hidden when the user clicks anywhere on the page except for whithin the div. What is the best way to do this? Really, I only need to support ie6+ but cross browser is always nice.
4
1653
by: webgour | last post by:
Hello, I'm having difficulty using attachEvent instead of simply assigning to mouseover in my object Sample03. When i use myImage.onmouseover = this.showmouseover(); in the following all works fine, if I replace it by myImage.attachEvent('onmouseover',this.showmouseover()); I get for the alert(this.id) "undefined" and not "gwlogo" <html> <head>
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.