Navigating a page

bharanidharanit

Well-known member
Joined
Dec 8, 2008
Messages
53
Location
India
Programming Experience
1-3
Hello,
I am having 3 pages default.aspx, default1.aspx and default2.aspx
Default.aspx is the home page.
When i click default2.aspx, it must check whether i have logged in, if not it must redirect to a login page(default1.aspx)
 
are you using the built login controls and authentication?

If so then you can either check it out programatically or modify the web.config to redirects all unauthenticated users to the login page.

VB.NET:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] User.Identity.IsAuthenticated [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]   Response.Redirect([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"Default1.aspx"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE]
 
Back
Top