ASP.NET中在本页面弹出窗口,主页面变成灰色

其实就是几个DIV层 = =

加一个让主页面半透明的层

<div id="doing" style="display:none; Z-INDEX: 12000; LEFT: 0px; WIDTH: 100%; CURSOR: wait; POSITION: absolute;TOP: 0px; HEIGHT:92%;background-color:#f9fff6;FILTER: alpha( Style=3 FinishOpacity=30);">  

    </div>

加一个弹出的页面层:

 <div id="AddState" style="display:none;position:absolute; width:220px;height:80px;text-align:center;vertical-align:middle;left: 350px; top: 224px; z-index:13000;background-image:url(../Images/body_bg.gif);border-right: lightgrey thin dashed; border-top: lightgrey thin dashed; border-left: lightgrey thin dashed; border-bottom: lightgrey thin dashed;">

    <div style="padding:3px 15px 3px 15px;text-align:left;vertical-align:middle;" >

        <div>状态名称:<asp:TextBox ID="tbState" runat="server" Width="100" ></asp:TextBox><asp:Button ID="btnAddState" runat="server"  onclick="btnAddState_Click" Text="添加" />

            <input id="BttCancel" type="button" value=" 取消 " onclick="ShowNo()" />

            <div>

            <asp:RequiredFieldValidator id="rfN" runat="server" ErrorMessage="状态名称不能为空!" ControlToValidate="tbState" CssClass="Text">

            </asp:RequiredFieldValidator>

            </div>

        </div>

  </div>

  </div>

再加上JS控制显示:

<script language='javascript'>

        function Show() {

            document.getElementById("doing").style.display = "";

            document.getElementById("AddState").style.display = "";

        }

        function ShowNo() {

            document.getElementById("doing").style.display = "none";

            document.getElementById("AddState").style.display = "none";

        }

        function HideLoginDiv() {

            var Login = document.getElementById("Javascript.Div5");

            Login.style.visibility = "hidden";

        }



    </script>

然后,下面你懂得。。。

方法转自CSDN论坛:http://topic.csdn.net/u/20080720/14/d8481f88-3ca1-4643-815b-c99cda043933.html

PS:8楼

你可能感兴趣的:(asp.net)