62,271
社区成员
发帖
与我相关
我的任务
分享
//写在pageload里
int i = 1;
if (i == 1)
{
ClientScript.RegisterStartupScript(this.GetType(), "open", "<script type=\"text/javascript\"> var str = document.getElementById(\"hid\"); alert(str.value=window.showModalDialog(\"b.aspx?UserName=123\"));</script>");
}
if (hid.Value == "1")
{
Response.Write("b.aspx");
}
protected void Page_Load(object sender, EventArgs e)
{
string userName = Request.QueryString["UserName"].ToString();
}
protected void Button1_Click(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "open", "<script type=\"text/javascript\">window.returnValue = 1;window.close(); </script>");
}
<asp:Panel ID="PanelLogin" runat="server">
<table cellpadding="0" cellspacing="5" align="center" bgcolor="#aaccdd" style="width: 300px">
<tr>
<td colspan="2" style="background-color: Gray; height: 20px;">
<strong>用户登录</strong>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblWrong" runat="server"></asp:Label></td>
</tr>
<tr style="height: 32px;">
<th style="width: 163px">
用户名</th>
<td align="left" style="width: 291px">
<asp:TextBox ID="txtLogin" runat="server" Width="146px">
</asp:TextBox>
</td>
</tr>
<tr style="height: 32px;">
<th style="width: 163px">
密码</th>
<td align="left" style="width: 291px; height: 28px;">
<asp:TextBox ID="txtPass" runat="server" TextMode="Password" Width="145px">
</asp:TextBox>
</td>
</tr>
<tr height="40" valign="top">
<td colspan="2" style="text-align: center;">
<asp:ImageButton runat="server" ID="imgLogin" ImageUrl="Images/az-login-gold-3d.gif"
OnClick="imgLogin_Click" CausesValidation="False" />
<asp:ImageButton ID="CancelBtn" runat="server" ImageUrl="Images/az-login-return-3d.gif" />
</td>
</tr>
</table>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="hid"
PopupControlID="PanelLogin" DropShadow="true" CancelControlID="CancelBtn" Drag="true"
BackgroundCssClass="bgcss">
</cc1:ModalPopupExtender>
</asp:Panel>
<input id="hid" type="hidden" runat="server" />
