Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

i've two pages(Login.aspx and User.aspx).I'll try to explain what is happening in application server(i.e,Asp.Net development server) then i will come to IIS.

In Application server,
While start browsing Login.aspx page will appear(since Login.aspx is start up page).then i'll enter login details that will direct to the User.aspx page,this is fine.If i'm trying to browse User.aspx,that should redirect to Login.aspx only.for that i've used following code:

C#
if (DTO.dtoLogin.temp == null)//DTO.dtoLogin.temp is property and if login occur temp will be 1.
            {
                Response.Redirect("Login.aspx");

            }
            DTO.dtoLogin.temp = null;


i'm happy to say that its working fine.
In IIS,

First time if i'm trying to open that User.aspx page,it will redirect to the Login.aspx page,this is fine.If i entered login details immediatelly direct to User.aspx page if details correct.After that,i'll try to open User.aspx page (by entering somethinglike http://198.162.0.131/demo/User.aspx),its openning,actually this should not happen instead it should redirect to Login.aspx page.



i hope you are getting this and please reply with an example.
Posted
Comments
Parwej Ahamad 25-Jun-11 4:55am    
I think so it is working fine, because once user get authenticated then can visit authorized pages. According to your concept, user will always by pass through Login page?
Is there any special purpose?
Tarun Mangukiya 25-Jun-11 6:37am    
Ya you are right
VallarasuS 26-Jun-11 0:51am    
Why dont you use Sessions instead of having such info in properties. if session is null you can redirect the user always to login page from any pages.

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