同样是使用的是AjaxPrio,有关设置的问题就不多说了,直接进入正题。
先给出模态串口的代码;
1
<script language=javascript>
2
var usename;
3
var userpwd;
4
var success;
5
function show()
6
}
下面是css的样式2
3
4
5
6
1
<style>
2
</style>
下面是模态窗口的html2
1
<body>
2
3
<DIV id="divModal" style="z-index: 100"></div>
4
<DIV id="divModalDialog" style="z-index: 101" >
5
<div class="titleBar">
6
<div class="closeButton"><a href="javascript:closeModal();">[关闭]</a></div>
7
</div>
8
<div class="mainBody" id="mainbb">
9
<div>
10
</DIV>
11
<form id="form1" runat=server >
12
用户名:<input id="username" type="text" /><br />
13
密码:
14
<input id="userpwd" type="password" /><br />
15
<input id="Button1" type="button" value="登陆" language="javascript" onclick="return Button1_onclick()" />
16
</form>
17
</body>
然后就是cs文件了
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
1
using System;
2
using System.Data;
3
using System.Configuration;
4
using System.Collections;
5
using System.Web;
6
using System.Web.Security;
7
using System.Web.UI;
8
using System.Web.UI.WebControls;
9
using System.Web.UI.WebControls.WebParts;
10
using System.Web.UI.HtmlControls;
11
using System.Data.SqlClient;
12
namespace login
13
这基本上就是全部了,但需要注意的是,模态窗口在html页面是可以正常显示的,但在.net中却出现了问题,div的位置改变了,这个问题是我最头疼的问题,找了好多的资料都没找到答案,但突然有个念头闪过,就是把<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">给删了,果然成功了,但为什么删除我就不清楚了,呵呵呵!2
3
4
5
6
7
8
9
10
11
12
13