Friday, 29 April 2011

Web.config file - ASP.NET

<connectionStrings>
<add name="BalloonShopConnection" connectionString="Server=(local)\SqlExpress;
         Integrated Security=True;
         Database=BalloonShop"
         providerName="System.Data.SqlClient"/>
</connectionStrings>
//put the <add> key in one line. and use first bracket () in server=(local)\SqlExpress
<appSettings>
    <add key="MailServer" value="www.mail.stcharles.ac.uk" />
    <add key="EnableErrorLogEmail" value="false" />
    <add key="ErrorLogEmail" value="mah@stcharles.ac.uk" />
    <add key="SiteName" value="BalloonShop"/>
    <add key="ProductsPerPage" value="6"/>
    <add key="ProductDescriptionLength" value="60"/>
</appSettings>

<!--Only administrators are allowed to access CatalogAdmin.aspx-->
<location path="CatalogAdmin.aspx">
    <system.web>
      <authorization>
        <allow roles="Administrators"/>
        <deny users="*"/>
      </authorization>
    </system.web>
</location>

<authentication mode="Forms">
<forms name="BalloonShopLogin" loginUrl="Login.aspx" timeout="15" />
</authentication>

<system.web>
    <roleManager enabled="true" />
    <customErrors mode="RemoteOnly" defaultRedirect="Oooops.aspx">
    </customErrors>

<pages theme="BalloonShopDefault">
                  <controls>
                        .. .. ..
                  </controls>
</pages>

No comments:

Post a Comment