服务端TextBox焦点事件
/*JavaScript代码部分*/
<script language="javascript" type="text/javascript">
function onTextBoxBlur()
{
document.getElementById("btnHidden").click();
}
</script>
/*Aspx代码部分*/
<input id="btnHidden" type="button" value="HiddenButton" style="display:none;" runat="server" onserverclick="btnHidden_ServerClick" />
<asp:TextBox ID="txtAmountCode" runat="server" onblur="onTextBoxBlur();" Width="200px"></asp:TextBox>
/*CS代码部分*/
protected void btnHidden_ServerClick(object sender, EventArgs e)
{
//事件
}
<script language="javascript" type="text/javascript">
function onTextBoxBlur()
{
document.getElementById("btnHidden").click();
}
</script>
/*Aspx代码部分*/
<input id="btnHidden" type="button" value="HiddenButton" style="display:none;" runat="server" onserverclick="btnHidden_ServerClick" />
<asp:TextBox ID="txtAmountCode" runat="server" onblur="onTextBoxBlur();" Width="200px"></asp:TextBox>
/*CS代码部分*/
protected void btnHidden_ServerClick(object sender, EventArgs e)
{
//事件
}