• TextBox 控件录入 ,异步调用后台程序验证


    要求步骤,及实现程序。

    1、在html中,响应的一个基本单位是表单 form, 表单默认的动作模式是  method="post"

    <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server" Style="z-index: 100;
    left: 143px; position: absolute; top: 44px" OnTextChanged="TextBox1_TextChanged"  onblur="submitform()"></asp:TextBox>

    <asp:Label ID="Label1" runat="server" Height="21px" Style="z-index: 102; left: 19px;
     position: absolute; top: 45px" Text="前台录入内容" Width="105px"></asp:Label>
    <asp:Label ID="Label2" runat="server" Height="21px" Style="z-index: 102; left: 144px;
    position: absolute; top: 95px" Width="140px"></asp:Label>
    <asp:Label ID="Label3" runat="server" Height="21px" Style="z-index: 102; left: 19px;
    position: absolute; top: 99px" Text="显示后台内容" Width="105px"></asp:Label>

    </div>
    </form>

    2、前台程序程序

    <!--异步调用后台程序-->

    <script type="text/javascript" language="javascript">
    function submitform()
    {
      var myForm=document.forms["form1"];
      myForm.action="";
      myForm.submit();
    }

    </script>

    3、后台程序

    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
          Label2.Text = TextBox1.Text;
    }

  • 相关阅读:
    基于nginx结合openssl实现https
    更新续约与重新登陆
    DNS服务器
    ELK日志分析系统。
    OpenSSH远程控制
    DHCP配置
    DHCP服务概述
    网络服务
    磁盘配额
    磁盘配额
  • 原文地址:https://www.cnblogs.com/gongyu/p/3683167.html
Copyright © 2020-2023  润新知