Deal with button action event arguments: x, y coordinates (C#)
<%@ 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.java2s.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>
Related examples in the same category