Click here to Skip to main content
15,888,088 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For example if i am navigate to my page from "https://help.salesforce.com/apex/HTViewHelpDoc?id=sso_saml_assertion_examples.htm&language=en", what value returned by this code "HttpContext.Current.Request.UrlReferrer"?
Posted

value returned by this code
"HttpContext.Current.Request.UrlReferrer" value is null

But if you need to first parameter value:
HttpContext.Current.Request.Params[0] value is "sso_saml_assertion_examples.htm"
 
Share this answer
 
Comments
Gopinath0072 26-Nov-13 2:02am    
why it is resut null? I think it should result something.
http referrer indicates the previous page that has submitted data or linked to the new page
you can get it in ASP.NET using like

C#
//PageName comes from HttpContext.Current.Request.RawUrl and is supplied by the Page_Load event.
public static string GetReferrerPageName()
{
    string functionReturnValue = null;

    if ((((System.Web.HttpContext.Current.Request.UrlReferrer) != null))) {
        functionReturnValue = HttpContext.Current.Request.UrlReferrer.ToString();
    } else {
        functionReturnValue = "N/A";
    }
    return functionReturnValue;
}
 
Share this answer
 
v2
Comments
Gopinath0072 26-Nov-13 2:42am    
is it returned with query string or not, if not how it results the above mentioned url (i.e. https://help.salesforce.com/apex/HTViewHelpDoc?id=sso_saml_assertion_examples.htm&language=en)?
Yes it will return the previous url where you have posted back to current page
Get more information
http://msdn.microsoft.com/en-us/library/system.web.httprequest.urlreferrer(v=vs.110).aspx
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900