写一个alert语句

来源:百度知道 编辑:UC知道 时间:2024/06/14 21:13:14
try
{
while (mydr.Read())
{ Label1.Text = (mydr["username"].ToString() + mydr["password"].ToString() + mydr["gender"].ToString() + mydr["birthplace"].ToString() + mydr["birth"].ToString() + "<br>"); }
}
catch
{
Response.Write "alert('helloworld!');"
}
这里的alert怎样写才通过啊

catch(Exception e)
{
Response.Write("<script language='javascript'>alert('" + e.Message + "');</script>");
}

不好意思没看好题目,这么写:
Page.RegisterStartupScript("1","<script language='javascript'>alert('helloworld');</script>");