public class Script
{
public static void Alert(string message)
{
ResponseScript(" alert('" + message + "');");
}
public static void ResponseScript(string script)
{
HttpContext.Current.Response.Write("script type=\"text/javascript\">\n//![CDATA[\n");
HttpContext.Current.Response.Write( script );
HttpContext.Current.Response.Write("\n//]]>\n/script>\n");
}
}
script type="text/javascript">
//![CDATA[
alert('温馨提示:有重复的用户!');
window.history.back();
//]]>
/script>
//将:
context.Response.ContentType = "text/plain";
//改为:
context.Response.ContentType = "text/html";