我遇到了问题。在C#上调用html输入标签时,它不会触发任何事件。您能否对下面的html代码和c#代码给出建议?
<input type="submit" id="btnBeforeOk" runat="server" name="btnBeforeOk" value="Login" onserverclick="BtnBeforeOk_ServerClick" />
protected void BtnBeforeOk_ServerClick(object sender, EventArgs e)
{
Label1.Text = "Youhana";
}
}
答案 0 :(得分:0)
您是否尝试过这样的按钮代码:
<script language="C#" runat="server">
protected void BtnBeforeOk_ServerClick(object sender, EventArgs e) {
....
}
</script>