Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Response.Redirect() in Page_Load
Message
De
06/06/2008 03:05:08
 
 
À
05/06/2008 22:44:38
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01322028
Message ID:
01322045
Vues:
10
Hi,

Using Server.Transfer() instead of Response.Redirect() may work for you.
http://www.codeguru.com/csharp/.net/net_asp/miscellaneous/article.php/c5359__1 explains the differences.
HTH,
Viv

>I want to verify the user whether is authenticated before the page is loaded. If user is not authenticated, redirect the page to login page. after login, transfer back to 1st page.
>
>But I can't get the Request.UrlReferrer in login.aspx. How to solve the problem.
>
>What is the best practice for this ?
>
>
>
>My code :
>
>In my 1st webform : customer.aspx
>
>
> protected void Page_Load(object sender, EventArgs e)
> {
> if (User.Identity.IsAuthenticated == false)
> {
> Response.Redirect("login.aspx");
> }
> }
>
>
>in 2nd page : login.aspx
> protected void Page_Load(object sender, EventArgs e)
> {
> if (Request.UrlReferrer != null) //<---- alway get null
> {
>
> Label1.Text = Request.UrlReferrer.ToString();
> }
> }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform