学习文章:http://www.cnblogs.com/kingteach/archive/2010/11/12/1875633.html

练习代码:

前台:

 1 <html xmlns="http://www.w3.org/1999/xhtml">
 2 <head runat="server">
 3     <title></title>
 4     <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
 5     <script language="javascript" type="text/javascript">
 6         $(document).ready(function () {
 7         });
 8 
 9         function CheckUnitNameExist() {
10             var name = $("#TextBox1").get(0).value;
11             PageMethods.CheckName(name, jsFunc);
12         }
13         function jsFunc(result) {
14             alert(result);
15         }
16     </script>
17 </head>
18 <body >
19 
20     <form id="form1" runat="server">
21      <asp:ScriptManager ID="ScriptManager1" runat="server"  EnablePageMethods="true">  </asp:ScriptManager>
22     <div>
23         请输入姓名:
24         <asp:TextBox ID="TextBox1"  runat="server" Width="200" onchange="CheckUnitNameExist()"></asp:TextBox>
25     </div>
26     </form>
27 </body>
28 </html>
View Code

相关文章:

  • 2022-12-23
  • 2021-09-17
  • 2021-09-16
  • 2022-03-10
  • 2022-12-23
  • 2022-02-07
  • 2022-02-16
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案