后台代码: ClientScript.RegisterStartupScript(this.GetType(), "msg", "<script>alert('用户帐户或用户密码错误,不能登录系统!!!')</script>");
前台样式:
<head runat="server">
<title>IT资产管理系统</title>
<link href="images/Default.css" type=text/css rel=stylesheet>
<link href="images/xtree.css" type=text/css rel=stylesheet>
<link href="images/User_Login.css" type=text/css rel=stylesheet></style>
</head>
<body id=userlogin_body>
<form id="form1" runat="server">
<div>
<DIV id=user_login>
<DL>
<DD id=user_top
<UL>
<LI class=user_top_l></LI>
<LI class=user_top_c></LI>
<LI class=user_top_r></LI></UL>
<DD id=user_main>
<UL>
<LI class=user_main_l></LI>
<LI class=user_main_c>
<DIV class=user_main_box>
<UL>
<LI class=user_main_text>用户名: </LI>
<LI class=user_main_input>
<asp:TextBox ID="txtUserName" runat="server" Width="159px"></asp:TextBox>
</LI></UL>
<UL>
<LI class=user_main_text>密 码: </LI>
<LI class=user_main_input>
<asp:TextBox ID="txtUserPassword" runat="server" TextMode="Password" Width="159px"></asp:TextBox>
</LI></UL>
<UL>
<LI class=user_main_text></LI>
<LI class=user_main_input> </LI></UL></DIV></LI>
<LI class=user_main_r>
<asp:ImageButton ID="ImgLogin" runat="server"
ImageUrl="~/images/user_botton.gif"
onclick="ImgLogin_Click" />
</LI></UL>
<DD id=user_bottom>
<UL>
<LI class=user_bottom_l></LI>
<LI class=user_bottom_c><SPAN style="MARGIN-TOP: 40px"> </SPAN> </LI>
<LI class=user_bottom_r></LI></UL></DD></DL></DIV><SPAN id=ValrUserName
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrPassword
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrValidateCode
style="DISPLAY: none; COLOR: red"></SPAN>
<DIV id=ValidationSummary1 style="DISPLAY: none; COLOR: red"></DIV>
</div>
</form>
提交失败后有些地方都错位了,怎么回事啊?
前台样式:
<head runat="server">
<title>IT资产管理系统</title>
<link href="images/Default.css" type=text/css rel=stylesheet>
<link href="images/xtree.css" type=text/css rel=stylesheet>
<link href="images/User_Login.css" type=text/css rel=stylesheet></style>
</head>
<body id=userlogin_body>
<form id="form1" runat="server">
<div>
<DIV id=user_login>
<DL>
<DD id=user_top
<UL>
<LI class=user_top_l></LI>
<LI class=user_top_c></LI>
<LI class=user_top_r></LI></UL>
<DD id=user_main>
<UL>
<LI class=user_main_l></LI>
<LI class=user_main_c>
<DIV class=user_main_box>
<UL>
<LI class=user_main_text>用户名: </LI>
<LI class=user_main_input>
<asp:TextBox ID="txtUserName" runat="server" Width="159px"></asp:TextBox>
</LI></UL>
<UL>
<LI class=user_main_text>密 码: </LI>
<LI class=user_main_input>
<asp:TextBox ID="txtUserPassword" runat="server" TextMode="Password" Width="159px"></asp:TextBox>
</LI></UL>
<UL>
<LI class=user_main_text></LI>
<LI class=user_main_input> </LI></UL></DIV></LI>
<LI class=user_main_r>
<asp:ImageButton ID="ImgLogin" runat="server"
ImageUrl="~/images/user_botton.gif"
onclick="ImgLogin_Click" />
</LI></UL>
<DD id=user_bottom>
<UL>
<LI class=user_bottom_l></LI>
<LI class=user_bottom_c><SPAN style="MARGIN-TOP: 40px"> </SPAN> </LI>
<LI class=user_bottom_r></LI></UL></DD></DL></DIV><SPAN id=ValrUserName
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrPassword
style="DISPLAY: none; COLOR: red"></SPAN><SPAN id=ValrValidateCode
style="DISPLAY: none; COLOR: red"></SPAN>
<DIV id=ValidationSummary1 style="DISPLAY: none; COLOR: red"></DIV>
</div>
</form>
提交失败后有些地方都错位了,怎么回事啊?
用这个试试 ViewState下面输出 。
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('aaaa');", true);