如何使用onclick事件发送值?
问题描述:
我有以下按钮如何使用onclick事件发送值?
<asp:ImageButton ID="button1" runat="server"
ImageUrl="~/image.jpg"
CommandName = "id"
CommandArgument = "1"
onclick="button1_Click"
/>
,并在后面
protected void button1_Click(object sender, ImageClickEventArgs e)
{
Response.Write(e.commandName);
}
这个代码不工作!,所以我的问题是如何获得价值frombutton控制?