CS0117: “ASP.printbower_aspx”并不包含对“response”的定义
出现CS0117错误可能是什么原因?大家帮忙呀。代码如下
void Page_Load(Object sender, EventArgs e)
{
if(Session[ "phone "] == null && Session[ "phone "].ToString() == " ")
{
this.response.write( "alert(\ "您的登录信息已经过期,请重新登录!\ ");document.location.href= '/password.aspx '; ");
}
在 <script language= "C# " runat=server> 这样的语句里不能用response.write的吗?
------解决方案--------------------response==> Response
------解决方案--------------------大小写的问题吧
------解决方案--------------------this.Response.Write
------解决方案--------------------if(Session[ "phone "] == null ||
Session[ "phone "].ToString() == " ")
------解决方案--------------------如果Session[ "phone "] == null成立Session[ "phone "].ToString() == " "就会报错。
&&-> ||
------解决方案--------------------if(Session[ "phone "] == null || Session[ "phone "].ToString() == " ")