response.write问题。
<%@ Page Language= "C# " AutoEventWireup= "true " CodeFile= "login.aspx.cs " Inherits= "login " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<script runat= "server " >
public void hell_click(object sender, EventArgs e)
{
if (TextBox1.Text == "aa " && TextBox2.Text == "bb ")
{
FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, PersistCookies.Checked);
}
else
{
Response.Write( "hfdsfsfs ");
Response.Write( " <script> alert( '无此用户 ') </script> ");
}
}
</script>
上面只是代码片段。内容也容易就是点击按钮时就运行hell_click。问题就是Response.Write( " <script> alert( '无此用户 ') </script> ");
出错不知道哪有问题。呼呼。还有别的方法不?
------解决方案--------------------写成这样
Response.Write( " <script language=javascript> alert( '无此用户 '); </s "+ "cript> ");
------解决方案--------------------少个;
再把language=javascript加上
再不行,就看楼下的