Hiding Direct URL access to user
I am developing an online banking system. i have a page userpage.aspx which will be shown in the browser when the user login is successful. My Question user must be prevented to view userpage.aspx directly if he/she types "http://olb/userpage.aspx".
Satyapriya NayakPosted Jan 23, 2014, 11:27 PM
http://www.dotnetcurry.com/showarticle.aspx?ID=270
http://stackoverflow.com/questions/4026125/how-do-i-prevent-url-entry-and-redirect-the-user-to-login-page
http://stackoverflow.com/questions/4834387/how-to-redirect-users-to-an-asp-net-page-when-not-authorized
http://www.extremeexperts.com/net/articles/implementingpassportauth.aspx
Biswa Pujarini MohapatraPosted Jan 23, 2014, 10:39 PM
Use Request.ServerVariables["HTTP_REFERER"] to find request is coming from your site or not
if(Request.ServerVariables["HTTP_REFERER"].ToLower().IndexOf("mysite.com") == -1){
// Not from my site
Response.Redirect("NotAllowed.aspx");
also you can use
asp.net location tag in web.config if you are using authentication