Archive for April, 2008

IE6 div height

ie-7-bug1.jpgHet zetten van de div height in IE6 is niet zo simpel als je zou denken. Ik wilde een dunne lijn maken mbv een div met een hoogte van 1px :


div.footerBar
{
    background: #FF6600;
    width: 100%;
    height: 1px;
}

Dit is voldoende voor firefox en IE 7. Helaas kreeg ik in IE 6 een lelijke dikke balk. Dit is op te lossen door overflow:hidden toe te voegen:


div.footerBar
{
    background: #FF6600;
    width: 100%;
    height: 1px;
    overflow:hidden;
}

Een nettere oplossing is zoals Wilbert al zei, gewoon een hr tag gebruiken met de volgende css:


hr
{
   border:0;
   height:1px;
   color:red;
   background:red;
} 

Multiple sitemaps

Om meerdere sitemaps te kunnen gebruiken in je asp.net website moet de web.config uitgebreid worden met de sitemap property:


<sitemap defaultprovider="XmlSiteMapProvider" enabled="true">
<providers>
<add sitemapfile="web.sitemap" name="XmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" securitytrimmingenabled="true"></add>
<add sitemapfile="my.sitemap" name="MyXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" securitytrimmingenabled="true"></add>
</providers>
</sitemap></pre>
Om de andere sitemap te gebruiken voeg een SiteMapDatasource toe aan de pagina:
<pre lang="html">
<asp:sitemapdatasource id="SiteMapDataSource1" runat="server" sitemapprovider="MyXmlSiteMapProvider"></asp:sitemapdatasource>

Deze kan nu gebind worden aan een navigatie control (treeview, menu)

System.Security.SecurityException: Security error

Wanneer een virtual directory niet op een lokale harde schijf staat maar op een netwerk share treedt de volgende exception op:

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file.
Exception Details: System.Security.SecurityException: Security error.

Dit wordt veroorzaakt doordat de virtual directory niet binnen de My_Computer_Zone code group valt. Dit is als volgt op te lossen:

1. On the Web server, open Administrative Tools, and then double-click Microsoft .NET Framework Configuration.
2. Expand Runtime Security Policy, expand Machine, and then expand Code Groups.
3. Right-click All_Code, and then click New.
4. Select Create a new code group. Give your code group a relevant name, such as the name of the applications share. Click Next.
5. In the Choose the condition type for this code group list, select URL.
6. In the URL box, type the path of the share in the following format:

file:////\\computername\sharename\*

Note Replace computername with the name of the computer that is hosting the remote share. Replace sharename with the name of the share.

7. Click Next. On the next page, select Use an existing permission set, and then select FullTrust.
8. Click Next, and then click Finish.
9. Restart Microsoft Internet Information Services (IIS) to restart the ASP.NET worker process

Bron: http://support.microsoft.com/kb/320268