Which code fragment should you add to the Web.config file?

You create a Microsoft ASP.NETWeb application by using the Microsoft .NET Framework
version 3.5.You plan to set up authentication for the Web application. The application must
support users from untrusted domains.You need to ensure that anonymous users cannot
access the application. Which code fragment should you add to the Web.config file?

You create a Microsoft ASP.NETWeb application by using the Microsoft .NET Framework
version 3.5.You plan to set up authentication for the Web application. The application must
support users from untrusted domains.You need to ensure that anonymous users cannot
access the application. Which code fragment should you add to the Web.config file?

A.
<system.web>
<authentication mode=”Forms”>
<forms loginUrl=”login.aspx” />
</authentication>
<authorization>
<deny users=”?” />
</authorization>
</system.web>

B.
<system.web>
<authentication mode=”Forms”>
<forms loginUrl=”login.aspx” />
</authentication>
<authorization>
<deny users=”*” />
</authorization>
</system.web>

C.
<system.web>
<authentication mode=”Windows”>
</authentication>
<authorization>
<deny users=” ” />
</authorization>
</system.web>

D.
<system.web>
<authentication mode=”Windows”>
</authentication>
<authorization>
<deny users=”*” />
</authorization>
</system.web>

Explanation:
The syntax to deny anonymous users is <deny users=”?” />



Leave a Reply 0

Your email address will not be published. Required fields are marked *