Mega Code Archive

 
Categories / ASP.Net / Asp Control
 

Deal with button action event arguments

<%@ Page Language="C#" %> <script runat="server">     protected void btnElephant_Click(object sender, ImageClickEventArgs e)     {         lblX.Text = e.X.ToString();         lblY.Text = e.Y.ToString();      } </script> <html> <head>     <title>Show EventArgs</title> </head> <body>     <form id="form1" runat="server">     <div>          <asp:ImageButton         id="btnElephant"         ImageUrl="http://www.rntsoft.com/style/logo.png"         Runat="server" OnClick="btnElephant_Click" />          <br />     X Coordinate:     <asp:Label         id="lblX"         Runat="server" />     <br />     Y Coordinate:     <asp:Label         id="lblY"         Runat="server" />          </div>     </form> </body> </html>