Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I designed one Login Page when i add authorization tag into web.config file the total design would changed like images and icons are not appeared.
i am using this code for authorization

XML
<authentication mode="Forms">
        <forms loginUrl="LoginPage.aspx" timeout="2880" />
      </authentication>
      <authorization>
        <deny users="?"/>
<allow users = "*"/>
      </authorization>



Please share any idea to me.

Please check my login page aspx code:

ASP.NET
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Styles/LOUPeStyles.css" rel="stylesheet" type="text/css" />
    <link href="CSS/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="CSS/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
     
      html, body {
        background-color: #eee;
      }
      body {
        padding-top: 80px; 
      }
      .container {
        width: 250px;
      }

      .container > .contentt {
        background-color: #fff;
        padding: 0 0 12px;
        margin: 250px -40px; 
        -webkit-border-radius: 10px 10px 10px 10px;
           -moz-border-radius: 10px 10px 10px 10px;
                border-radius: 10px 10px 10px 10px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
                box-shadow: 0 1px 2px rgba(0,0,0,.15);
      }
      .contentt .form-signin-heading
{
    margin-bottom: 20px;
    background-color: #0082AA;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    color: #FFFFFF;
    font-weight: normal;
    text-indent: 20px;
}
	  .login-form {
		margin-left: 40px;
	  }
	
	  #ContentPlaceHolder1_btnlogin {
        margin-top: -30px;
        margin-left: 186px;
      }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div class="container">

      <div class="contentt">
        <h2 class="form-signin-heading">Sign in </h2>
         <asp:Label ID="lblmsg" runat="server"></asp:Label>
        <div class="login-form">
         <div class="input-prepend">
              <span class="add-on"></span>
               <asp:TextBox ID="txtpassword" runat="server"  
                    placeholder="Password" TextMode="Password"></asp:TextBox>
             </div>
             <asp:RequiredFieldValidator ID="rfvPWD" runat="server" 
        ControlToValidate="txtpassword" ErrorMessage="Please enter Password" 
        ForeColor="#CC3300" ValidationGroup="validate" EnableClientScript="false" />
            <label class="checkbox">
                <asp:CheckBox ID="rememberchecked" runat="server" Text="Keep me signed in"  />
            </label>
            <asp:Button ID="btnlogin" runat="server" Text="Login" 
            CssClass="btn btn-primary" onclick="btnlogin_Click" />
            </div>
      </div>

    </div> <!-- /container -->
    ^__i class="icon-user">
</asp:Content>
Posted
Updated 7-Nov-13 0:21am
v8
Comments
♥…ЯҠ…♥ 7-Nov-13 5:40am    
Could you place image tag here?
♥…ЯҠ…♥ 7-Nov-13 8:38am    
I asked, where and how you have given your image path in the application... give me that snippet...I faced the similar issue while deploying in MVC application thats why am asking for mentioned image path

1 solution

Your need to add the folder location where you have the styles and images inside web.config on this way:

XML
<location path="CSS">
   <system.web>
     <authorization>
       <allow users="*"/>
     </authorization>
   </system.web>
 </location>


This allows the user get those files without being authenticated.
 
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