.NET实现License Key输入功能 ASP.NET实现License Key输入功能的小例子

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

.NET实现License Key输入功能 ASP.NET实现License Key输入功能的小例子

  2021-03-18 我要评论
想了解ASP.NET实现License Key输入功能的小例子的相关内容吗,在本文为您仔细讲解.NET实现License Key输入功能的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:License,Key,输入,功能,下面大家一起来学习吧。

 

这个演示,在输入时,是不需要与服务端交互,只有全部输入完毕之后,用户点铵钮才进行验证。因此在这里,写Javascript来实现即可。

js:

复制代码 代码如下:

<script type="text/javascript">
        function JumpToNextTextBox(currentTxtBox, nextTextBoxID) {
            if (currentTxtBox.value.length >= 5) {
                document.getElementById(nextTextBoxID).focus();
            }
        }
    </script>


Html code:

复制代码 代码如下:

  License Key:
            <asp:TextBox ID="Number1" runat="server" onkeyup="JumpToNextTextBox(this, 'Number2')" Width="65"></asp:TextBox>
            -
        <asp:TextBox ID="Number2" runat="server" onkeyup="JumpToNextTextBox(this, 'Number3')" Width="65"></asp:TextBox>
            -
        <asp:TextBox ID="Number3" runat="server" onkeyup="JumpToNextTextBox(this, 'Number4')" Width="65"></asp:TextBox>
            -
        <asp:TextBox ID="Number4" runat="server" onkeyup="JumpToNextTextBox(this, 'Number5')" Width="65"></asp:TextBox>
            -
        <asp:TextBox ID="Number5" runat="server" MaxLength ="5" Width="65"></asp:TextBox>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们