zoukankan      html  css  js  c++  java
  • 弹出一个登录层,并对登录进行校验

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="弹出层.aspx.cs" Inherits="弹出层" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <!-- 这里一段JS的代码,主要是两个方法。一个是隐藏层。一个是打开层 -->

        <script language="javascript" type="text/javascript">
        
          function ShowDiv(){
         var Show = document.getElementById("login");
         Show.style.position = "absolute";
         Show.style.visibility = "visible";
         Show.style.display = "block";
    }
    function ClosDiv(){
    var Clos = document.getElementById("login");
    Clos.style.visibility = "hidden";
    Clos.style.display = "none";
    }
    function LoginIn()
    {
    alert('a');
     var username=document.getElementById("username");
     var password=document.getElementById("passwodr");
     alert(username.value);
     alert(password.value);
     if(username.value=="admin"&&password.value=="admin")
     {
         window.location.href("Default.aspx");
     }
    }
        </script>

    </head>
    <body>
        <a href="#" onclick="ShowDiv()">登录</a> <a href="#" onclick="ClosDiv()">取消</a>
        <div id="login" style="visibility: hidden; display: none; border: 1px #CCCCCC solid;
            300px;">
            <div style=" 300px; height: 20px; background-color: #CCCCFF; display: block">
                <div style=" 5px; height: 5px; margin-left: 140px; margin-top: 5px;">
                    <input type="submit" value="X" onclick="ClosDiv()" width="2px;" height="2px;" />
                </div>
            </div>
            <div>
                <form action="">
                    用户名:<input type="text" id="username" /><br />
                    密 码:
                    <input id="passwodr" type="password" /><br />
                    <input id="btnlogin" type="button" value="登录" onclick="LoginIn()" />&nbsp;&nbsp;&nbsp;
                    <input type="reset" value="清空" />
                    <input type="button" value="关闭" onclick="ClosDiv()" />
                </form>
            </div>
        </div>
    </body>
    </html>

  • 相关阅读:
    通过C#来加载X509格式证书文件并生成RSA对象
    .NET删除字节数组中的0字节
    让.NET 4.0支持TLS1.2协议
    剖析信用卡 DCC 交易
    Python私有变量
    Python中类的定义
    SQL join中on与where区别
    Python私有函数和公开函数
    Python实现装饰模式的一段代码
    Python的sorted函数应用
  • 原文地址:https://www.cnblogs.com/wangyhua/p/4050659.html
Copyright © 2011-2022 走看看