Click here to Skip to main content
14,300,956 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi,I have created a login screen.I want this screen to be the default entry screen when I launch my application..I should be able to access the other screen via the login screen..no other screen may be accessed by typing in a URL. how can i do this.. this is what I have done

<appSettings>
    <add key="xxxx" value="http://swetha.documents/"/>
    <add key="xxxx" value="http://swetha.documents.com"/>
        <add key="Base" value="/App_CodeFiles/web.config"/>
        <add key="Location" value="/CodeFiles/Chart.config"/>

        <add key="Url" value="https://ivs/login.aspx"/>
    <add key="Sup" value="983469"/>
    <add key="Su" value="sweta@honeywell.com"/>

    <add key="Handler" value="storage=memory;timeout=20;"/>
  </appSettings>
Posted
Updated 15-Mar-12 21:50pm
v2
Rate this:
Please Sign up or sign in to vote.

Solution 1

The easiest way is to implement Membership, and have the default.aspx redirect to the login screen. All other screens then reside in a separate folder which requires a logged in user to access them. Implementing Membership will set the appropriate web.config settings you need.
See here: http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx[^]
   
Comments
V. 16-Mar-12 4:13am
   
Nice, didn't think of that. I'll check this out as well.
Rate this:
Please Sign up or sign in to vote.

Solution 2

1. Create a login screen, upon successful submitting the details you save the login in a Session object.
2. On all other pages, in the Page_Load event handler you check the Session object, if OK = continue else redirect to Login screen.

That should do the trick and also redirects the user to login when the session expires.

Hope this helps.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

A good tutorial on ASP.NET 2.0 Membership and Roles is given here
http://www.4guysfromrolla.com/articles/120705-1.aspx[^]

It may be helpful to you.
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100