Click here to Skip to main content
15,913,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI EVREY BODY first bay name of Christus and Maria
Beissm Patris et Filii et Spiritus Sancti
Beissm Father, Son and Holy Spirith
iam hapy because i have been gradute fromm university
this year imeet some of you working in code A project
may name is eiad
I LOVE YOU AND I BELIEVE IN YOU AND YOUR IDEAS AND IAM HAPPY FOR EVRY BODY



BAY ALL OF ALL SOME OF YOU ASK ME TO TALK WITH YOU WE CAN YOU CAN SEE MAY EMAIL
AND TALK WITH ME

THE QUESTION??:
BAY ALL OF ALL
: I HAVE APROJECT CONTAIN 20 PAGE I WANT TO MAKE SOME PAGES TO BE NOT OPEN WITHOUT LOG IN PAGE AND OTHER TO BE OPEN BAY USUAL WAY
XML
configuration>
    <system.web>
        <authentication mode="Forms" >
            <forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" >
            </forms>
        </authentication>
<!-- This section denies access to all files in this application except for those that you have not explicitly specified by using another setting. -->
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
<!-- This section gives the unauthenticated user access to the Default1.aspx page only. It is located in the same folder as this configuration file. -->
        <location path="default1.aspx">
        <system.web>
        <authorization>
            <allow users ="*" />
        </authorization>
        </system.web>
        </location>
<!-- This section gives the unauthenticated user access to all of the files that are stored in the Subdir1 folder.  -->
        <location path="subdir1">
        <system.web>
        <authorization>
            <allow users ="*" />
        </authorization>
        </system.web>
        </location>
</configuration>





IHAVE DONE THAT BUT I WANT YOUR OPENION AND SOUUTION
Posted
Updated 20-Jun-11 22:23pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Jun-11 4:20am    
Congratulations! You probably had exciting day. Have a good sleep and come back to your question later. Use "Improve question".
Good luck,
--SA
lovercsharpasp 21-Jun-11 10:28am    
thank you Dominus Valiparkk Valiparkk Christ thank you

You may follow the steps below.

1. Choose and Implement one of the authentication mode.
2. Define authorization levels as shown below.

XML
<configuration>
    <system.web>
        <authentication mode="Forms" >
            <forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" >
            </forms>
        </authentication>
<!-- This section denies access to all files in this application except for those that you have not explicitly specified by using another setting. -->
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
<!-- This section gives the unauthenticated user access to the Default1.aspx page only. It is located in the same folder as this configuration file. -->
        <location path="default1.aspx">
        <system.web>
        <authorization>
            <allow users ="*" />
        </authorization>
        </system.web>
        </location>
<!-- This section gives the unauthenticated user access to all of the files that are stored in the Subdir1 folder.  -->
        <location path="subdir1">
        <system.web>
        <authorization>
            <allow users ="*" />
        </authorization>
        </system.web>
        </location>
</configuration>


3. Another way is to group the aspx files to
folders depending on their authorization level.
3. Have separate web.config for each of the folders with
XML
<system.web>
        <authorization>
            <allow users ="*" />
        </authorization>
        </system.web>


Cheers
Balaji
 
Share this answer
 
You need to build an authorisation system in a base class, and derive your pages that need log in, from that base class. The base class would check a session variable to see if the user is logged in, and, if not, redirect to the login page.
 
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