My website has around 100 aspx. Out of this, a certain 20
aspx files should be made available to the users only
if they are logged in. How can I achieve this with the
web.config file?
Answer Posted / rajesh
<configuration>
<appSettings>
<add key="DSN" value="user id=user;password=user;data
source=192.168.0.102;database=shp_cart"/>
</appSettings>
<connectionStrings>
</connectionStrings>
<system.web>
<authentication mode="Forms">
<forms cookieless="UseCookies"
defaultUrl="private/productcatalogue.aspx"
loginUrl="Index.aspx" timeout="30" protection="All"
name="LoginPage">
<credentials passwordFormat="SHA1"></credentials>
</forms>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true"/>
</system.web>
<location allowOverride="true" path="private">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
<compilation debug="true"/></system.web>
</location>
</configuration>
Is This Answer Correct ? | 1 Yes | 5 No |
Post New Answer View All Answers
What kind of data we can store in viewstate?
What are the ways of preserving data on a Web Form in ASP.NET?
How to comment out asp.net tags?
Write some code using interfaces, virtual methods, and an abstract class`
Explain Areas in MVC?
what is DLL Hell and how it is solved in .NET? please explain clearly??
What is asp net objects?
What is data grid view in asp.net?
Explain the difference between dataset and datareader.
Explain the difference between page.registerclientscriptblock and page.registerstartupscript?
Difference between response.redirect and server.transfer?
Why session is necessary in web application?
How can we create a website?
Define xmlvalidatingreader class.
what are the Custom controls in asp.net?