非静态字段,方法或属性'System.Web.UI.UserControl.Response.get需要对象引用 [英] object reference is required for the non-static field, method, or property 'System.Web.UI.UserControl.Response.get

查看:68
本文介绍了非静态字段,方法或属性'System.Web.UI.UserControl.Response.get需要对象引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在site.master中编写了代码,但它无法正常工作。

请帮助我。

I have written the code in site.master but its not working.
please help me.

if i use this code on site.master.cs
[WebMethod]
public static void CheckSession()
{
if (Session[KaizenConstants.CURRENTLOGGEDINUSER] == null)
{
Response.Redirect("Login.aspx");
}
}
 
I am getting the error as :
Error	69	An object reference is required for the non-static field, method, or property 'System.Web.UI.UserControl.Response.get'.





谢谢

Harshal。



Thanks
Harshal.

推荐答案

这可以帮到你



http://stackoverflow.com/questions/10505187/an-object-reference-is-required- for-the-static-field-method-or-property-s [ ^ ]



http://stackoverflow.com/questions/3247342/cs0120-an-object-reference -is-required [ ^ ]
This may help you

http://stackoverflow.com/questions/10505187/an-object-reference-is-required-for-the-non-static-field-method-or-property-s[^]

http://stackoverflow.com/questions/3247342/cs0120-an-object-reference-is-required[^]


这篇关于非静态字段,方法或属性'System.Web.UI.UserControl.Response.get需要对象引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆