Re: [C#] check I come from ...

lior levi <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
Hello,

Like this:

 

protected void Page_Load(object sender, System.EventArgs e)

{

string[] whereFrom= Request.ServerVariables.GetValues("HTTP_REFERER");

check_validity(whereFrom[0]);

}

 

public void check_validity(string whereFrom)

      { 

      bool page = false;

      if
(whereFrom.Equals("http://localhost/handasa/teacher/teacherlogin.asp")) 

page=true;              

 

      if (!(page))

            Response.Redirect("access_error.aspx");

      }

 

 

 

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:[email protected]] On Behalf Of Gabriel
Sent: Thursday, May 10, 2007 1:23 PM
To: [email protected]
Subject: [DOTNET-WEB] [C#] check I come from ...

 

Hello,

 

In an ASP.NET 2.0 application, I have 3 pages :

- a.spx

- b.aspx

- c.aspx

 

I'd like check when I load b.aspx than I come from a.aspx, if not redirect

to another page, how can I do that ?

 

Regards,

 

===================================

This list is hosted by DevelopMentor®  http://www.develop.com

 

View archives and manage your subscription(s) at http://discuss.develop.com


===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.