How to avoid direct URL entering problem in vb.net

liunx

Guest
Hai everybody,

In my vb.net project, i need to include the below functionality.
If any one will enter the URL directly using address bar after login into the site, it should redirect the user to login page. Users has to browse the site using the links only. But now it is not redirectign the user.How to avoid this problem? I had tried

If Request.UrlReferrer.ToString = "" Then
response.redirect ("logout.aspx")
end if

But it is nor working.

pls suggest me.

Regards,
Siva RDid you put this code in your global.asax Application_BeginRequest function? Where did you put it?I am assuming you mean if a user has not logged into your application you want to do a response.redirect to the login page? I just use the asp.net session and then if the session has a length of 0 (using len="") I redirect them. I use a simple if statement to accomplish this.
 
Back
Top