Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Request.ServerVariables
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00758280
Message ID:
00762489
Vues:
24
What happens if you put your code in Page_Load instead of Session_Start?


>When I use this code I get the correct refering page as expected.
>
><script language="c#" runat="server">
>  void Page_Load(Object sender, EventArgs e)
>  {
>    NameValueCollection coll;
>    Response.Write("Refering Page: " + coll.Get("HTTP_REFERER") + "<br>");
>  }
>
>
>But when I use this other code I get the my home page as the refering page. I don't understand why?
>
>protected void Session_Start(Object sender, EventArgs e)
>{
>  NameValueCollection coll = Request.ServerVariables;
>  string cHttpReferer = coll.Get("HTTP_REFERER");
>
>  // Then I save the information to a database
>}
>
>I have all the namespaces in place and the code compiles without any problems.
>
>I want to achieve the same result as if I'm putting my C# code inline with my HTML Code - how can I do this?
>
>TIA
Hector Correa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform