global_asax的Application_Error上的HTTP_REFERER为null [英] HTTP_REFERER is null on global.asax's Application_Error

查看:55
本文介绍了global_asax的Application_Error上的HTTP_REFERER为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。有没有办法在global.asax中使用application_error时能找到HTTP_REFERER

的值?


我正在使用:


if(HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]!=

null)

{

referencia =

HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]。ToString();

}


和它仍然是null

解决方案

尝试在start sub上的会话中检测引用者,然后将其存储在
$中b $ b会话变量。你可以从应用程序错误子中调用它。


我认为值得一试

Seguros Catatumbo < se ************** @ gmail.comwrote in message

news:11 **************** ******@19g2000hsx.googlegro ups.com ...


大家好。有没有办法在global.asax中使用application_error时能找到HTTP_REFERER

的值?


我正在使用:


if(HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]!=

null)

{

referencia =

HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]。ToString();

}


和它仍为空


浏览器可选择发送此值。


- 布鲁斯( sqlwork.com)


Seguros Catatumbo写道:


大家好。有没有办法在global.asax中使用application_error时能找到HTTP_REFERER

的值?


我正在使用:


if(HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]!=

null)

{

referencia =

HttpContext.Current.Request.ServerVariables [" HTTP_REFERER"]。ToString();

}


和它仍然是空的


" Seguros Catatumbo" < se ************** @ gmail.comwrote in message

news:11 **************** ****** @19g2000hsx.googlegro ups.com ...


有没有办法可以找出HTTP_REFERER的价值



不是100%可靠 - 有些浏览器故意不发送这个,有些

ISP故意将其从标题中删除......


你想要实现什么......?

-

Mark Rae

ASP.NET MVP
http://www.markrae.net


Hi everyone. Is there a way i can find out the value of HTTP_REFERER
when using application_error in global.asax?

I am using:

if (HttpContext.Current.Request.ServerVariables["HTTP_REFERER"] !=
null)
{
referencia =
HttpContext.Current.Request.ServerVariables["HTTP_REFERER"].ToString();
}

and it still is null

解决方案

try detecting the referrer in the session on start sub, then store it in a
session variable. you can then call it from the application error sub.

I think it worth a try
"Seguros Catatumbo" <se**************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...

Hi everyone. Is there a way i can find out the value of HTTP_REFERER
when using application_error in global.asax?

I am using:

if (HttpContext.Current.Request.ServerVariables["HTTP_REFERER"] !=
null)
{
referencia =
HttpContext.Current.Request.ServerVariables["HTTP_REFERER"].ToString();
}

and it still is null


it is optional for the browser to send this value.

-- bruce (sqlwork.com)

Seguros Catatumbo wrote:

Hi everyone. Is there a way i can find out the value of HTTP_REFERER
when using application_error in global.asax?

I am using:

if (HttpContext.Current.Request.ServerVariables["HTTP_REFERER"] !=
null)
{
referencia =
HttpContext.Current.Request.ServerVariables["HTTP_REFERER"].ToString();
}

and it still is null


"Seguros Catatumbo" <se**************@gmail.comwrote in message
news:11**********************@19g2000hsx.googlegro ups.com...

Is there a way i can find out the value of HTTP_REFERER

Not 100% reliably - some browsers deliberately do not send this, and some
ISPs deliberately strip it from headers...

What are you trying to achieve...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


这篇关于global_asax的Application_Error上的HTTP_REFERER为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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