Click here to Skip to main content
15,900,572 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to enable in an asp.net applications that if a user is accesing a page without login then he/she must be redirected to the first page of our website?
Posted
Updated 26-Nov-10 2:14am
v2

You can use form/session authentiocation to achive this.....

Go through the below links.. this may help you

Form auth[^]

Session auth[^]
 
Share this answer
 
Comments
TweakBird 26-Nov-10 13:50pm    
good call
how to implemet this in
If isnothing(session("ssnLogin")) = True Then
Response.Redirect("loginpage.aspx")
End If

bcoz there is no such IsNothing method in C#.Net
 
Share this answer
 
Write your code like
C#
If(Session["ssnLogin"] == null)
 {
     Response.Redirect("loginpage.aspx");
 }
 
Share this answer
 
Comments
TweakBird 26-Nov-10 13:52pm    
good call
Thanx Sir,It helped but i have one more problem that if there is master page already operated with default.aspx page and i have one more page that is about.html and if i want that in contentplaceholder of master page i want to show the data that is written in about.html in runtime is this possible or not?
 
Share this answer
 
Check the session. If login is successful u need to set one session. so check this session in every page load.
If isnothing(session("ssnLogin")) = True Then 
     Response.Redirect("loginpage.aspx")
End If
 
Share this answer
 
put answer 4 code in master page .cs file (page_load event). use iframe to display html in same page at runtime.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900