日期:2014-05-17 浏览次数:20417 次
<form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div> 姓名:<asp:TextBox ID="txtUserName" runat="server" ontextchanged="txtUserName_TextChanged" AutoPostBack="true"></asp:TextBox> <asp:Label ID="lblErrorMessage" runat="server" Text=""></asp:Label> </div> <div> 密码:<asp:TextBox ID="txtUserPwd" runat="server"></asp:TextBox> </div> <div> <asp:Button ID="btnOk" runat="server" Text="确定" /> </div> </ContentTemplate> </asp:UpdatePanel> </div> </form>
------解决方案--------------------
写一个JQuery就完啦
$(function(){
$("#tbox_username").blur(function(){
$.ajax({
url:"" //提交到哪个地址去执行
type:"" //提交方式'post' or 'get'
data:{"":""} //如果有参数可以用data传递
success:function(){
//成功后执行的操作
}
})
})
})
------解决方案--------------------
。。。 <form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div>
姓名:<asp:TextBox ID="txtUserName" runat="server"
ontextchanged="txtUserName_TextChanged" AutoPostBack="true"></asp:TextBox>
<asp:Label ID="lblErrorMessage" runat="server" Text=""></asp:Label>
</div>
<div>
密码:<asp:TextBox ID="txtUserPwd" runat="server"></asp:TextBox>
</div>
<div>
<asp:Button ID="btnOk" runat="server" Text="确定" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>