开发者

Login Page Design and Authorization

In my website, the Web.config is as follows:

 <system.web>
       <compilation debug="true" targetFramework="4.0">
         <assemblies>
            <add ..../>
         </assemblies>
       </compilation>
     <authentication mode="Forms">
       <forms loginUrl="Login.aspx"></forms>
     </authentication>
     <authorization>
      <allow users="admin" />
      <deny users="?" />
     </authorization>
    </system.web>

I've tried to design the login page but it seems like whatever I do it doesn't appear, and after looking for a solution I'e found this:

"i guess i got it. since you are denying other pages in web config unless user authenticated. Allow image folder also in web config file like you are allowing login page,similarly allow image folder,css,javascript folder etc. Image should show up in page. It should work."开发者_如何学运维

The problem is I don't know how to allow these folders, can anyone help?


Refering to location Element (ASP.NET Settings Schema):

The location element specifies the resource that child configuration settings apply to and is also used to lock configuration settings, preventing the settings from being overridden by child configuration files.

The location element can enclose other elements, either to apply configuration settings to a specific resource or to lock the settings.

<configuration>
   <location path="Images">
      <system.web>
         <authorization>
            <allow users="?"/>
         </authorization>
      </system.web>
   </location>
</configuration>


You can add exceptions to your web.config file:

<location path="foldername">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜