关于 asp.net 的 httpApplication 对象 、
public void Init(HttpApplication context)
{
context.Context.Response; // 获取当前 http响应的 httpResponse对象
context.Response; // 获取当前内部对应的对象。
这两个有什么区别?
}
[解决办法]
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public HttpResponse Response
{
get
{
HttpResponse response = null;
if ((this._context != null) && !this._hideRequestResponse)
{
response = this._context.Response;
}
if (response == null)
{
throw new HttpException(SR.GetString("Response_not_available"));
}
return response;
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Browsable(false)]
public HttpContext Context
{
get
{
if (this._context == null)
{
return this._initContext;
}
return this._context;
}
}