我想制作如下代码的程序:
void accessBySession(String user, String webqname)
{
...
Response.Write("<script>alert('You can't access this page !');document.location='dashboard.aspx'; </script> ");
}
我添加了using System.Web;
,但命令响应仍有错误(名称&#39;响应&#39;在当前上下文中不存在。)
如何解决这个问题?
答案 0 :(得分:0)
尝试完整的命名空间:
System.Web.HttpContext.Current.Response.Write("<script>alert('You can't access this page !');document.location='dashboard.aspx'; </script>)