first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

C# and ASP.NET Code Snippet: Manually Wiring Up Events in Visual Studio.NET 2003

/* This works well when commandHTML is of type="submit" or "image". According to the strategies table under "Handling a Click Event in Client and Server Code" in "ASP.NET Server Control Event Model" under "Visual Basic and Visual C# Concepts." */ protected System.Web.UI.WebControls.Button commandServer; protected System.Web.UI.HtmlControls.HtmlInputButton commandHTML;

private void commandHTML_ServerClick(object Source, EventArgs e) { Response.Write("commandHTML_ServerClick"); } private void commandServer_Click(object Source, EventArgs e) { Response.Write("commandServer_Click"); } private void Page_Load(object sender, System.EventArgs e) { commandHTML.ServerClick +=new EventHandler(commandHTML_ServerClick); commandServer.Click +=new EventHandler(commandServer_Click); }

mod date: 2004-04-02T02:54:46.000Z