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


Please Help Members By Posting Answers For Below Questions

What kind of data we can store in viewstate?

572


What are the ways of preserving data on a Web Form in ASP.NET?

616


How to comment out asp.net tags?

627


Write some code using interfaces, virtual methods, and an abstract class`

1577


Explain Areas in MVC?

645






what is DLL Hell and how it is solved in .NET? please explain clearly??

1882


What is asp net objects?

517


What is data grid view in asp.net?

530


Explain the difference between dataset and datareader.

527


Explain the difference between page.registerclientscriptblock and page.registerstartupscript?

568


Difference between response.redirect and server.transfer?

545


Why session is necessary in web application?

509


How can we create a website?

532


Define xmlvalidatingreader class.

562


what are the Custom controls in asp.net?

562