|
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace EventsAcrossControls
{
public class ReceiverControl : UserControl
{
protected Literal uxMessage;
private void Page_Load (object sender, EventArgs e)
{
ButtonEvents events = new ButtonEvents(Context.Items);
events.ImageButtonClicked += new ImageClickEventHandler(events_ImageButtonClicked);
events.ButtonClicked += new EventHandler(events_ButtonClicked);
}
private void events_ImageButtonClicked (object sender, ImageClickEventArgs e)
{
uxMessage.Text =
string.Format("Last event received from an image button at ({0}, {1})", e.X, e.Y);
}
private void events_ButtonClicked (object sender, EventArgs e)
{
uxMessage.Text = "Last event received from a button";
}
override protected void OnInit (EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent ()
{
Load += new EventHandler(Page_Load);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have programmed applications in ASP.NET from the very beginning. My favourite .NET language is C#, and I am a fan of Test Driven Design. I was an experienced VB6 coder before the .NET era. I have also done some Transacted SQL programming in Sql Server. Although I have made a career on Microsoft technology, I have browsed enough Java code to read it fluently, and I find Smalltalk and Ruby very interesting.
I live a few kilometers away from Oslo.
My email is
thomas.eyde@gmail.com.