架构师_程序员_码农网

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

搜索
查看: 19318|回复: 4

[ASP.NET] ASP.NET----实现点击按钮或链接弹出登录对话框

[复制链接]
发表于 2015-7-19 14:35:26 | 显示全部楼层 |阅读模式
2011072809314690.jpg
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="zhaozhao.aspx.cs" Inherits="JqueryZhezhao.zhaozhao" %>

  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5.     <title></title>
  6.     <scrip去掉t src="jquery-1.6.1.min.js" type="text/javascrip去掉t"></scrip去掉t>
  7.     <scrip去掉t type="text/javascrip去掉t" language="javascrip去掉t">
  8.         function ShowNo()                        //隐藏两个层
  9.         {
  10.             document.getElementById("doing").style.display = "none";
  11.             document.getElementById("divLogin").style.display = "none";
  12.         }
  13.         function $(id) {
  14.             return (document.getElementById) ? document.getElementById(id) : document.all[id];
  15.         }
  16.         function showFloat()                    //根据屏幕的大小显示两个层
  17.         {
  18.             var range = getRange();
  19.             $('doing').style.width = range.width + "px";
  20.             $('doing').style.height = range.height + "px";
  21.             $('doing').style.display = "block";
  22.             document.getElementById("divLogin").style.display = "";
  23.         }
  24.         function getRange()                      //得到屏幕的大小
  25.         {
  26.             var top = document.body.scrollTop;
  27.             var left = document.body.scrollLeft;
  28.             var height = document.body.clientHeight;
  29.             var width = document.body.clientWidth;

  30.             if (top == 0 && left == 0 && height == 0 && width == 0) {
  31.                 top = document.documentElement.scrollTop;
  32.                 left = document.documentElement.scrollLeft;
  33.                 height = document.documentElement.clientHeight;
  34.                 width = document.documentElement.clientWidth;
  35.             }
  36.             return { top: top, left: left, height: height, width: width };
  37.         }
  38. </scrip去掉t>
  39.     <style type="text/css">
  40.           body{margin:0px;}
  41.     </style>
  42. </head>
  43. <body>
  44.     <form id="form1" runat="server">
  45.     <a href="javascrip去掉t:void(0)" onclick="showFloat()">登陆 </a>    //登陆链接
  46.     <!--加一个半透明层-->
  47.     <div id="doing" style="filter:alpha(opacity=30);-moz-opacity:0.3;opacity:0.3;background-color:#000;width:100%;height:100%;z-index:1000;position: absolute;left:0;top:0;display:none;overflow: hidden;">
  48.     </div>   
  49.     <!--加一个登录层-->
  50.     <div id="divLogin" style="border:solid 10px #898989;background:#fff;padding:10px;width:780px;z-index:1001; position: absolute; display:none;top:50%; left:50%;margin:-200px 0 0 -400px;">
  51.             <div style="padding:3px 15px 3px 15px;text-align:left;vertical-align:middle;" >
  52.                 <div>
  53.                     用户:
  54.                   <asp:TextBox ID="TxtUserName" runat="server" > </asp:TextBox>
  55.                 </div>
  56.                 <div>
  57.                     密码:
  58.                   <asp:TextBox ID="TxtUserPwd" runat="server" TextMode="Password" > </asp:TextBox>
  59.                 </div>
  60.                 <br/>
  61.                 <div>     
  62.                     <asp:Button ID="BttLogin" runat="server" Text=" 登 陆 "/>  
  63.                     <input id="BttCancel" type="button" value=" 取 消 " onclick="ShowNo()" />
  64.                 </div>
  65.             </div>
  66.       </div>
  67.     </form>
  68. </body>
  69. </html>
复制代码






上一篇:安装SQL Server 2008时 总是不断要求重启电脑的解决办法
下一篇:@RenderBody、@RenderSection、@RenderPage、Html.RenderPartial、Html.RenderActi...
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2015-7-20 12:34:46 | 显示全部楼层
http://7x2xhq.com1.z0.glb.clouddn.com/wp-content/uploads/2015/07/20150718150713100.html
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2015-7-20 14:30:42 | 显示全部楼层
Delver_Si 发表于 2015-7-20 12:34
http://7x2xhq.com1.z0.glb.clouddn.com/wp-content/uploads/2015/07/20150718150713100.html

拒绝访问
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2015-7-25 22:16:12 | 显示全部楼层
用easyui
码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
发表于 2015-7-25 22:20:11 | 显示全部楼层
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title></title>

    <scrip去掉t src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></scrip去掉t>

    <scrip去掉t>
        $(function () {
            $("#div1").hide();


            $("#btn1").click(function ()
            {
                if ($("#h").val()=="0") {
                    $("#div1").show();
                    $("#h").val("1");
                } else{
                    $("#div1").hide();
                    $("#h").val("0");
                }

            });
        });

    </scrip去掉t>

</head>
<body  style="background-color:gray">
    <input  id="btn1" type="button" value="点我"/>

    <div id="div1" style ="width:300px; height:300px; background-color:white;  border-color:red; z-index:9999; top:10%; left:30%; position:fixed;  margin-left: auto; margin-right: auto;">

        <input id="h" hidden="hidden" value="0" /><br />
        <input /><br />
        <input /><br />
        2132112121
        sdsdf
        sdf
        sdf
        2132112121
        sdsdf
        sdf
        sdf
        dsf
        dsf

    </div>
    111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111 111111111111111111111111111111111111111111 111111111111111111111111111111111111111111 111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111 111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111 111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111 111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
     111111111111111111111111111111111111111111
</body>
</html>

码农网,只发表在实践过程中,遇到的技术难题,不误导他人。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

免责声明:
码农网所发布的一切软件、编程资料或者文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:help@itsvse.com

QQ|手机版|小黑屋|架构师 ( 鲁ICP备14021824号-2 )|网站地图

GMT+8, 2025-9-17 05:42

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表