<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Egil Hansen</title>
	<atom:link href="http://egilhansen.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://egilhansen.com</link>
	<description>.NET, Windows, ASP.Net, scripts</description>
	<lastBuildDate>Thu, 04 Feb 2010 13:32:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to take control of style sheets in ASP.NET Themes with the StylePlaceholder and Style control</title>
		<link>http://egilhansen.com/2008/11/30/how-to-take-control-of-style-sheets-in-aspnet-themes-with-the-styleplaceholder-and-style-control/</link>
		<comments>http://egilhansen.com/2008/11/30/how-to-take-control-of-style-sheets-in-aspnet-themes-with-the-styleplaceholder-and-style-control/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 11:22:49 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.egil.dk/?p=83</guid>
		<description><![CDATA[The problem is pretty simple. When using ASP.NET Themes you do not have much say in how your style sheets are rendered to the page.
The render engine adds all the style sheets you have in your themes folder in alphabetic order, using the &#60;link href=&#8221;&#8230;&#8221;?  notation.
We all know the order of the style sheets [...]]]></description>
			<content:encoded><![CDATA[<p>The problem is pretty simple. When using ASP.NET Themes you do not have much say in how your style sheets are rendered to the page.</p>
<p>The render engine adds all the style sheets you have in your themes folder in alphabetic order, using the &lt;link href=&#8221;&#8230;&#8221;?  notation.</p>
<p>We all know the order of the style sheets are important, luckily asp.net&#8217;s shortcomings can be circumvented by prefixing the style sheets with 01, 02, &#8230; , 99, and thus forcing the order you want (see Rusty Swayne <a href="http://rustyswayne.com/post.aspx?id=cba116ea-b672-4c90-9f4e-18b70ca2f50a">blog post</a> on the technique for more information).</p>
<p>This is especially important if you use a reset style sheet, which I highly recommend; it makes it much easier to style a site in a consistent form across browsers (take a look at <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Reset Reloaded from Eric Meyer</a>).</p>
<p>You also miss out of the possibility to specify a media type (e.g. screen, print, projection, braille, speech). And if you prefer to include style sheets using the @import method, you are also left out in the cold.</p>
<p>Another missing option is Conditional Comment, which is especially useful if you use an &#8220;ie-fix.css&#8221; style sheet.</p>
<p>Before I explain how the StylePlaceHolder and Style control resolve the above issues, credit where credit is due, my solution is inspired by <a href="http://www.dentaku.com/2007/01/take-control-over-stylesheet-order-and-media-when-using-asp-net-2-0-themes.aspx">Per Zimmermann&#8217;s blog post</a> on the subject.</p>
<p>The StylePlaceHolder control is placed in the header section of your master page or page. It can host one or more Style controls, and will remove styles added by the render engine by default, and add its own (it will only remove styles added from the current active theme).</p>
<p>The Style control can both host inline styles in-between it&#8217;s opening and closing tags and a reference to a external style sheet file through its CssUrl property. Through other properties you control how the style sheet it renders to the page.</p>
<p>Let me show an example. Consider a simple web site project with a master page and a theme with three style sheets &#8211; 01reset.css, 02style.css, 99iefix.cs. Note: I have named them using prefixing technique described earlier, as it makes for a better design time experience. Also, the tag prefix of the custom controls is &#8220;ass:&#8221;.</p>
<p>In the master page&#8217;s header section, add:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ass:StylePlaceHolder</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">&quot;StylePlaceHolder1&quot;</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">SkinID</span>=<span style="color: #ff0000;">&quot;ThemeStyles&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>In your theme directory, add a skin file (e.g. Styles.skin) and add the following content:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ass:StylePlaceHolder</span> <span style="color: #000066;">runat</span>=<span style="color: #ff0000;">&quot;server&quot;</span> <span style="color: #000066;">SkinId</span>=<span style="color: #ff0000;">&quot;ThemeStyles&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ass:Style</span> <span style="color: #000066;">CssUrl</span>=<span style="color: #ff0000;">&quot;~/App_Themes/Default/01reset.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ass:Style</span> <span style="color: #000066;">CssUrl</span>=<span style="color: #ff0000;">&quot;~/App_Themes/Default/02style.css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ass:Style</span> <span style="color: #000066;">CssUrl</span>=<span style="color: #ff0000;">&quot;~/App_Themes/Default/99iefix.css&quot;</span> <span style="color: #000066;">ConditionCommentExpression</span>=<span style="color: #ff0000;">&quot;[if IE]&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ass:StylePlaceHolder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>That is basically it. There are a more properties on the Style control that can be used to control the rendering, but this is the basic setup. With that in place, you can easily add another theme and replace all the styles, since you only need to include a different skin file.</p>
<p>The following is the code for the Style control:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.ComponentModel</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Security.Permissions</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #000000;">&#91;</span>assembly<span style="color: #008000;">:</span> TagPrefix<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Assimilated.Extensions.Web.Controls&quot;</span>, <span style="color: #666666;">&quot;ass&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">namespace</span> Assimilated.<span style="color: #0000FF;">WebControls</span>.<span style="color: #0000FF;">Stylesheet</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #000000;">&#91;</span>AspNetHostingPermission<span style="color: #000000;">&#40;</span>SecurityAction.<span style="color: #0000FF;">Demand</span>, Level <span style="color: #008000;">=</span> AspNetHostingPermissionLevel.<span style="color: #0000FF;">Minimal</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>AspNetHostingPermission<span style="color: #000000;">&#40;</span>SecurityAction.<span style="color: #0000FF;">InheritanceDemand</span>, Level <span style="color: #008000;">=</span> AspNetHostingPermissionLevel.<span style="color: #0000FF;">Minimal</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>DefaultProperty<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;CssUrl&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>ParseChildren<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span>, <span style="color: #666666;">&quot;InlineStyle&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>PersistChildren<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>ToolboxData<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&lt;{0}:Style runat=<span style="color: #008080; font-weight: bold;">\&quot;</span>server<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;&lt;/{0}:Style&gt;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>Themeable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> Style <span style="color: #008000;">:</span> Control
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> Style<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// set default value... for some reason the DefaultValue attribute do</span>
            <span style="color: #008080; font-style: italic;">// not set this as I would have expected.</span>
            TargetMedia <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;All&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#region Properties</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Style sheet&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Description<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;The url to the style sheet.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>UrlProperty<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;*.css&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> CssUrl
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Style sheet&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;All&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Description<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;The target media(s) of the style sheet. See http://www.w3.org/TR/REC-CSS2/media.html for more information.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> TargetMedia
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Style sheet&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span>EmbedType.<span style="color: #0000FF;">Link</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Description<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Specify how to embed the style sheet on the page.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> EmbedType Type
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>PersistenceMode<span style="color: #000000;">&#40;</span>PersistenceMode.<span style="color: #0000FF;">InnerDefaultProperty</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> InlineStyle
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Conditional comment&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Description<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Specifies a conditional comment expression to wrap the style sheet in. See http://msdn.microsoft.com/en-us/library/ms537512.aspx&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> ConditionalCommentExpression
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Conditional comment&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span>CommentType.<span style="color: #0000FF;">DownlevelHidden</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Description<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Whether to reveal the conditional comment expression to downlevel browsers. Default is to hide. See http://msdn.microsoft.com/en-us/library/ms537512.aspx&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> CommentType ConditionalCommentType
        <span style="color: #000000;">&#123;</span>
            get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Behavior&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> SkinID <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#endregion</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Render<span style="color: #000000;">&#40;</span>HtmlTextWriter writer<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>            
            <span style="color: #008080; font-style: italic;">// add empty line to make output pretty</span>
            writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// prints out begin condition comment tag</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>ConditionalCommentExpression<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>ConditionalCommentType <span style="color: #008000;">==</span> CommentType.<span style="color: #0000FF;">DownlevelRevealed</span> <span style="color: #008000;">?</span> <span style="color: #666666;">&quot;&lt;!{0}&gt;&quot;</span> <span style="color: #008000;">:</span> <span style="color: #666666;">&quot;&lt;!--{0}&gt;&quot;</span>,
                                 ConditionalCommentExpression<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>CssUrl<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>               
                <span style="color: #008080; font-style: italic;">// add shared attribute</span>
                writer.<span style="color: #0000FF;">AddAttribute</span><span style="color: #000000;">&#40;</span>HtmlTextWriterAttribute.<span style="color: #0000FF;">Type</span>, <span style="color: #666666;">&quot;text/css&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #008080; font-style: italic;">// render either import or link tag</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>Type <span style="color: #008000;">==</span> EmbedType.<span style="color: #0000FF;">Link</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #008080; font-style: italic;">// &lt;link href=\&quot;{0}\&quot; type=\&quot;text/css\&quot; rel=\&quot;stylesheet\&quot; media=\&quot;{1}\&quot; /&gt;</span>
                    writer.<span style="color: #0000FF;">AddAttribute</span><span style="color: #000000;">&#40;</span>HtmlTextWriterAttribute.<span style="color: #0000FF;">Href</span>, ResolveUrl<span style="color: #000000;">&#40;</span>CssUrl<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">AddAttribute</span><span style="color: #000000;">&#40;</span>HtmlTextWriterAttribute.<span style="color: #0000FF;">Rel</span>, <span style="color: #666666;">&quot;stylesheet&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">AddAttribute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;media&quot;</span>, TargetMedia<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">RenderBeginTag</span><span style="color: #000000;">&#40;</span>HtmlTextWriterTag.<span style="color: #0000FF;">Link</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">RenderEndTag</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
                <span style="color: #0600FF;">else</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #008080; font-style: italic;">// &lt;style type=&quot;text/css&quot;&gt;@import &quot;modern.css&quot; screen;&lt;/style&gt;</span>
                    writer.<span style="color: #0000FF;">RenderBeginTag</span><span style="color: #000000;">&#40;</span>HtmlTextWriterTag.<span style="color: #0000FF;">Style</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;@import <span style="color: #008080; font-weight: bold;">\&quot;</span>{0}<span style="color: #008080; font-weight: bold;">\&quot;</span> {1};&quot;</span>, ResolveUrl<span style="color: #000000;">&#40;</span>CssUrl<span style="color: #000000;">&#41;</span>, TargetMedia<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                    writer.<span style="color: #0000FF;">RenderEndTag</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>InlineStyle<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #008080; font-style: italic;">// &lt;style type=&quot;text/css&quot;&gt;... inline style ... &lt;/style&gt;</span>
                writer.<span style="color: #0000FF;">AddAttribute</span><span style="color: #000000;">&#40;</span>HtmlTextWriterAttribute.<span style="color: #0000FF;">Type</span>, <span style="color: #666666;">&quot;text/css&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                writer.<span style="color: #0000FF;">RenderBeginTag</span><span style="color: #000000;">&#40;</span>HtmlTextWriterTag.<span style="color: #0000FF;">Style</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                writer.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>InlineStyle<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                writer.<span style="color: #0000FF;">RenderEndTag</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// prints out end condition comment tag</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>ConditionalCommentExpression<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #008080; font-style: italic;">// add empty line to make output pretty</span>
                writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                writer.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>ConditionalCommentType <span style="color: #008000;">==</span> CommentType.<span style="color: #0000FF;">DownlevelRevealed</span> <span style="color: #008000;">?</span> <span style="color: #666666;">&quot;&lt;![endif]&gt;&quot;</span> <span style="color: #008000;">:</span> <span style="color: #666666;">&quot;&lt;![endif]--&gt;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">enum</span> EmbedType
    <span style="color: #000000;">&#123;</span>        
        Link <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>,
        Import <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span>,
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">enum</span> CommentType
    <span style="color: #000000;">&#123;</span>
        DownlevelHidden <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>,
        DownlevelRevealed <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>And the code for the StylePlaceHolder control:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.ComponentModel</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Security.Permissions</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.UI.HtmlControls</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #000000;">&#91;</span>assembly<span style="color: #008000;">:</span> TagPrefix<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Assimilated.Extensions.Web.Controls&quot;</span>, <span style="color: #666666;">&quot;ass&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">namespace</span> Assimilated.<span style="color: #0000FF;">WebControls</span>.<span style="color: #0000FF;">Stylesheet</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #000000;">&#91;</span>AspNetHostingPermission<span style="color: #000000;">&#40;</span>SecurityAction.<span style="color: #0000FF;">Demand</span>, Level <span style="color: #008000;">=</span> AspNetHostingPermissionLevel.<span style="color: #0000FF;">Minimal</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>AspNetHostingPermission<span style="color: #000000;">&#40;</span>SecurityAction.<span style="color: #0000FF;">InheritanceDemand</span>, Level <span style="color: #008000;">=</span> AspNetHostingPermissionLevel.<span style="color: #0000FF;">Minimal</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>DefaultProperty<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;SkinID&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>ToolboxData<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;&lt;{0}:StylePlaceHolder runat=<span style="color: #008080; font-weight: bold;">\&quot;</span>server<span style="color: #008080; font-weight: bold;">\&quot;</span> SkinID=<span style="color: #008080; font-weight: bold;">\&quot;</span>ThemeStyles<span style="color: #008080; font-weight: bold;">\&quot;</span>&gt;&lt;/{0}:StylePlaceHolder&gt;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>ParseChildren<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span>, <span style="color: #666666;">&quot;Styles&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>Themeable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #000000;">&#91;</span>PersistChildren<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> StylePlaceHolder <span style="color: #008000;">:</span> Control
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">private</span> List<span style="color: #008000;">&lt;</span>Style<span style="color: #008000;">&gt;</span> _styles<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Behavior&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ThemeStyles&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> SkinID <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #000000;">&#91;</span>Browsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
        <span style="color: #0600FF;">public</span> List<span style="color: #008000;">&lt;</span>Style<span style="color: #008000;">&gt;</span> Styles
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_styles <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                    _styles <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span>Style<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #0600FF;">return</span> _styles<span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> CreateChildControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_styles <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                return<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// add child controls</span>
            Styles.<span style="color: #0600FF;">ForEach</span><span style="color: #000000;">&#40;</span>Controls.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnLoad<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnLoad</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// get notified when page has finished its load stage</span>
            Page.<span style="color: #0000FF;">LoadComplete</span> <span style="color: #008000;">+=</span> Page_LoadComplete<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">void</span> Page_LoadComplete<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// only remove if the page is actually using themes</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>Page.<span style="color: #0000FF;">StyleSheetTheme</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">||</span> <span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>Page.<span style="color: #0000FF;">Theme</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #008080; font-style: italic;">// Make sure only to remove style sheets from the added by</span>
                <span style="color: #008080; font-style: italic;">// the runtime form the current theme.</span>
                var themePath <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;~/App_Themes/{0}&quot;</span>,
                                              <span style="color: #008000;">!</span><span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #000000;">&#40;</span>Page.<span style="color: #0000FF;">StyleSheetTheme</span><span style="color: #000000;">&#41;</span>
                                                  <span style="color: #008000;">?</span> Page.<span style="color: #0000FF;">StyleSheetTheme</span>
                                                  <span style="color: #008000;">:</span> Page.<span style="color: #0000FF;">Theme</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #008080; font-style: italic;">// find all existing stylesheets in header</span>
                var removeCandidate <span style="color: #008000;">=</span> Page.<span style="color: #0000FF;">Header</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">OfType</span><span style="color: #008000;">&lt;</span>HtmlLink<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
                    .<span style="color: #0000FF;">Where</span><span style="color: #000000;">&#40;</span>link <span style="color: #008000;">=&gt;</span> link.<span style="color: #0000FF;">Href</span>.<span style="color: #0000FF;">StartsWith</span><span style="color: #000000;">&#40;</span>themePath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #008080; font-style: italic;">// remove the automatically added style sheets</span>
                removeCandidate.<span style="color: #0600FF;">ForEach</span><span style="color: #000000;">&#40;</span>Page.<span style="color: #0000FF;">Header</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> AddParsedSubObject<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> obj<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// only add Style controls</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>obj <span style="color: #008000;">is</span> Style<span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">AddParsedSubObject</span><span style="color: #000000;">&#40;</span>obj<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>So what do you guys think? Is this a good solution to the asp.net theme problem? And what about the code? These two controls are my first attempt at writing custom server controls, so any input is very much welcome.</p>
<p>Get the code, <a href='http://egilhansen.com/wp-content/assimilatedwebcontrols.zip'>including Visual Studio 2008 solution and .dll</a> if you just want to use the controls.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/11/30/how-to-take-control-of-style-sheets-in-aspnet-themes-with-the-styleplaceholder-and-style-control/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Simply way of adding a default item to a data bound DropDownList</title>
		<link>http://egilhansen.com/2008/07/31/simply-way-of-adding-a-default-item-to-a-data-bound-dropdownlist/</link>
		<comments>http://egilhansen.com/2008/07/31/simply-way-of-adding-a-default-item-to-a-data-bound-dropdownlist/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 09:55:53 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[DropDownList]]></category>

		<guid isPermaLink="false">http://www.egil.dk/?p=81</guid>
		<description><![CDATA[I have always found it too difficult to add a &#8220;Choose xxxxx&#8221; item to the top of a DropDownList, when the DropDownList binds to a ObjectDataSource, SqlDataSource or similar. I almost always ended up just feeding the DropDownList its content from the code behind, even though it felt like something that should be possible directly. [...]]]></description>
			<content:encoded><![CDATA[<p>I have always found it too difficult to add a &#8220;Choose xxxxx&#8221; item to the top of a <code>DropDownList</code>, when the <code>DropDownList </code>binds to a <code>ObjectDataSource</code>, <code>SqlDataSource </code>or similar. I almost always ended up just feeding the <code>DropDownList </code>its content from the code behind, even though it felt like something that should be possible directly. The control do have a <code>AppendDataBoundItems </code>property, but most of the time you just end up with duplicated items.</p>
<p>Today I discovered the simplest and most elegant solution I&#8217;ve seen to date. One line of code in the code behind file is still required, but the elegance of DataSource controls is kept. In short, once the <code>DropDownList </code>has bound to its data source, add the &#8220;Choose xxxxx&#8221; item to the items collection of the DropDownList. The trick is to use the <code>Insert </code>method instead of the <code>Add </code>method, since the Insert method allows you to specify where the new item should be inserted, and not just added to the end of the item list.</p>
<p>In this example I use the <code>OnDataBound </code>event to insert the new item:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>asp<span style="color: #006600; font-weight: bold;">:</span>DropDownList ID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;ddlCustomer&quot;</span> runat<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;server&quot;</span> 
    DataSourceID<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;odsCustomer&quot;</span> DataTextField<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;DisplayName&quot;</span> 
    DataValueField<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;CustomerId&quot;</span> OnDataBound<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;ddlCustomer_DataBound&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>asp<span style="color: #006600; font-weight: bold;">:</span>DropDownList<span style="color: #006600; font-weight: bold;">&gt;</span></pre></div></div>

<p>The code behind is just one line of code (excluding the method definition):</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> ddlCustomer_DataBound<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ddlCustomer.<span style="color: #0000FF;">Items</span>.<span style="color: #0000FF;">Insert</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span>, <span style="color: #008000;">new</span> ListItem<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Choose a Customer&quot;</span>, <span style="color: #666666;">&quot;0&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/07/31/simply-way-of-adding-a-default-item-to-a-data-bound-dropdownlist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System.Diagnostics + ASP.Net Web Site &#8211; remember to set compilerOptions=&#8221;/d:TRACE&#8221;</title>
		<link>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/</link>
		<comments>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 21:18:42 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[System.Diagnostics]]></category>
		<category><![CDATA[Ukadc.Diagnostics]]></category>

		<guid isPermaLink="false">http://www.egil.dk/?p=80</guid>
		<description><![CDATA[Today I was looking at Ukadc.Diagnostics, an extension to the System.Diagnostics namespace, and decided to build a test website myself to get more familiar with it. After reading through Ukadc.Diagnostics Reference Example I thought it would be a homerun in the first try, but it turns out that without adding compilerOptions="/d:TRACE" to each compiler in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was looking at <a href="http://www.codeplex.com/UkadcDiagnostics">Ukadc.Diagnostics</a>, an extension to the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx">System.Diagnostics namespace</a>, and decided to build a test website myself to get more familiar with it. After reading through <a href="http://www.codeplex.com/UkadcDiagnostics/Wiki/View.aspx?title=QuickReferenceExample&amp;referringTitle=Home">Ukadc.Diagnostics Reference Example</a> I thought it would be a homerun in the first try, but it turns out that without adding <code>compilerOptions="/d:TRACE"</code> to each compiler in the compilers section in the Web.config, the tracing code is never compiled into the assemblies at runtime. Needless to say, I was scratching my head since my sample console application worked as expected the first time.</p>
<p>My compilers section ended up looking like this (it is located in the system.codedom section)</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compiler</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;c#;cs;csharp&quot;</span> <span style="color: #000066;">extension</span>=<span style="color: #ff0000;">&quot;.cs&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">compilerOptions</span>=<span style="color: #ff0000;">&quot;/d:TRACE&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">warningLevel</span>=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CompilerVersion&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;v3.5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WarnAsError&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compiler<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compiler</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;vb;vbs;visualbasic;vbscript&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">compilerOptions</span>=<span style="color: #ff0000;">&quot;/d:Trace=true&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">extension</span>=<span style="color: #ff0000;">&quot;.vb&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">warningLevel</span>=<span style="color: #ff0000;">&quot;4&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CompilerVersion&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;v3.5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;OptionInfer&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WarnAsError&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compiler<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compilers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Do note that this is not an issue with ASP.Net Web Applications, since they are precompiled. For more on the subject, <a href="http://msdn.microsoft.com/en-us/library/b0ectfxd.aspx">MSDN has a great article</a> which certainly saved me in this instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updates all over</title>
		<link>http://egilhansen.com/2008/05/10/updates-all-over/</link>
		<comments>http://egilhansen.com/2008/05/10/updates-all-over/#comments</comments>
		<pubDate>Sat, 10 May 2008 08:05:41 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Egil.dk]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[XML Driven Logon Script]]></category>

		<guid isPermaLink="false">http://www.egil.dk/?p=79</guid>
		<description><![CDATA[While the XML Driven Logon Script hit version 4.00k, I decided to give the site an overhaul as well. After a smooth update to the latest and greatest WordPress engine, I manage to tweak the famous Kubrick theme to better suite my tastes, a wider main column, and different colours in the header. It is [...]]]></description>
			<content:encoded><![CDATA[<p>While the <a href="/xml-driven-logon-script/">XML Driven Logon Script</a> hit version <a href="/xml-driven-logon-script/download/">4.00k</a>, I decided to give the site an overhaul as well. After a smooth update to the latest and greatest <a href="http://wordpress.org/">WordPress</a> engine, I manage to tweak the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a> theme to better suite my tastes, a wider main column, and different colours in the header. It is not big changes, but not much was needed.
</p>
<p>After putting the logon script online earlier this year, the feedback I have received has been rewarding to say the least. Two ideas I would like to find time to implement, is a more modular version of the script, where administrators are able to tidy out actions and other optional components they do not need. This will help keep the size of the script down, which currently stands at 44 kb. Another idea is making it easier for everyone to customize the messages the script print out during execution. Administrators will thus be able to translate the script to their own native language.
</p>
<p>When I will be able to find the time to implement the ideas above is hard to say, the weather is getting damn good here in Denmark, after all <img src='http://egilhansen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/05/10/updates-all-over/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>XML Driven Logon Script hit version 4.00g</title>
		<link>http://egilhansen.com/2008/02/19/xml-driven-logon-script-hit-version-400g/</link>
		<comments>http://egilhansen.com/2008/02/19/xml-driven-logon-script-hit-version-400g/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 22:48:11 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[XML Driven Logon Script]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2008/02/19/xml-driven-logon-script-hit-version-400g/</guid>
		<description><![CDATA[After a long day of updating, testing and documenting, the XML Driven Logon Script have hit version 4.00g.
I am still missing a section in the documentation, but that will have to wait to another day.
Take a look and let me know what you think.
]]></description>
			<content:encoded><![CDATA[<p>After a long day of updating, testing and documenting, the <a href="/xml-driven-logon-script/" title="XML Driven Logon Script">XML Driven Logon Script</a> have hit version 4.00g.</p>
<p>I am still missing a section in the documentation, but that will have to wait to another day.</p>
<p>Take a look and let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/02/19/xml-driven-logon-script-hit-version-400g/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Slow network transfer speeds in Vista due to media playback</title>
		<link>http://egilhansen.com/2007/12/26/slow-network-transfer-speeds-in-vista-due-to-media-playback/</link>
		<comments>http://egilhansen.com/2007/12/26/slow-network-transfer-speeds-in-vista-due-to-media-playback/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 13:31:53 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/12/26/slow-network-transfer-speeds-in-vista-due-to-media-playback/</guid>
		<description><![CDATA[I have been baffled by this every since switching to Vista last month. Sometimes I would only be able to get around 5 MB/sec transfer rates from my local server, while at other times it would max out around 10-12 MB/sec, which is as expected on a 100 Mbit network.

It turns out to be due [...]]]></description>
			<content:encoded><![CDATA[<p>I have been baffled by this every since switching to Vista last month. Sometimes I would only be able to get around 5 MB/sec transfer rates from my local server, while at other times it would max out around 10-12 MB/sec, which is as expected on a 100 Mbit network.
</p>
<p>It turns out to be due to a bug in the new Multimedia Class Scheduler Service (MMSCC) included in Vista, that will help prioritize processing and network resources during media playback. As <a href="http://blogs.technet.com/markrussinovich/archive/2007/08/27/1833290.aspx">Mark Russinovich explains in his blog</a>, the MMSCC will give media applications higher priority during playback, while at the same time throttle down network activity to ensure that streaming audio and video get through without glitches.
</p>
<p>The problem seems to come from the hardcoded limit that is forced upon the network card, which would give a computer with a single network card a maximum throughput of about 15 MB/sec., which in itself is not that bad. The problem surfaces when you have more than one network card (like most laptops), then a bug in the MMSCC will throttle the network connections even more.
</p>
<p>If you, like me, have multiple virtual network adapters from installing VMWare and various VPN software packages, you will have degradation out of proportions of what the MMSCC team intended for. Luckily, Microsoft has the networking and MMCSS team working on a fix for this. Meanwhile, remember to kill your online radio whenever you want to transfer data over the network at a reasonable speed.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/12/26/slow-network-transfer-speeds-in-vista-due-to-media-playback/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My favourite Vista tricks and tweaks</title>
		<link>http://egilhansen.com/2007/12/24/my-favourite-vista-tricks-and-tweaks/</link>
		<comments>http://egilhansen.com/2007/12/24/my-favourite-vista-tricks-and-tweaks/#comments</comments>
		<pubDate>Mon, 24 Dec 2007 00:00:00 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.egil.dk/1999/11/30/my-favourite-vista-tricks-and-tweaks/</guid>
		<description><![CDATA[I just recently installed Vista on my work PC, and have since been looking for different ways to get more out of Vista. Here is a (continually updated) list of my favourite Vista tricks and tweaks. Usability tricks and tweaks:
	

Wictor describes how you can customize the Favourite Links in Windows Vista common dialogs, which is [...]]]></description>
			<content:encoded><![CDATA[<p>I just recently installed Vista on my work PC, and have since been looking for different ways to get more out of Vista. Here is a (continually updated) list of my favourite Vista tricks and tweaks. <strong>Usability tricks and tweaks:</strong>
	</p>
<ul>
<li>Wictor describes how you can <a href="http://www.wictorwilen.se/Post/Customize-the-Favorite-Links-in-Windows-Vista-common-dialogs.aspx">customize the Favourite Links in Windows Vista common dialogs</a>, which is a lot simpler then completing the same <a href="http://suprbay.org/showthread.php?t=2180" title="Modify the ">feat in Windows XP</a>.
</li>
<li>Symbolic Links has finally made its way into the Windows family. Microsoft describes a &#8220;symbolic link is a file-system object that points to another file system object&#8221;, which can be sort of abstract to say the least. What it basically means is that you can go into C:\Users\Egil\Current Project\ and it will be the same as going in to C:\Users\Egil\Document\Customer\2007\Project Name\. In other words, C:\Users\Egil\Current Project\ is a symbolic link to C:\Users\Egil\Document\Customer\2007\Project Name\, it is just a shorter path which safes me mouse clicks. Think of it as an advanced way of creating shortcuts to things. The <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/symbolic_links.asp" title="Symbolic Links at MSDN">official documentation for symbolic links can be found on MSDN</a>. If my explanation just confused you, give <a href="http://en.wikipedia.org/wiki/NTFS_symbolic_link" title="NTFS symbolic link">Wikipedia&#8217;s a try</a>.
</li>
</ul>
<p><strong>Performance tricks and tweaks:</strong>
	</p>
<ul>
<li>On TweakVista there is a <a href="http://www.tweakvista.com/Article39099.aspx" title="Enhance SATA disk performance">short guide in getting a bit more speed out of your SATA disks</a>. Microsoft recommends only using this option if your disks have a backup power supply, like a battery in a laptop, otherwise you might lose data.
</li>
<li>Ever wondered why Vista suddenly starts hugging the hard disk around 01:00 on Wednesdays? Well the answer could be the scheduled defragging included in Vista (at least Business and Ultimate). If you are comfortable in handling your own defragging, go in to Task Scheduler and disable that &#8220;service&#8221;.
</li>
<li>Out of the box Vista has a lot of enabled services, which can be safely disabled, especially if you are not a corporate laptop user. The very geeky but always reliable <a href="http://www.blackviper.com/" title="Black Viper's Web Site">Black Viper</a> has always been the place to turn to, for a <a href="http://www.blackviper.com/WinVista/servicecfg.htm" title="www.BlackViper.com: Windows Vista Service Configuration">service guide for your favourite Windows edition</a>.
</li>
</ul>
<p><strong>Visual tricks and tweaks:<br />
</strong></p>
<ul>
<li>Vista comes with a rather big border size by default, more precisely a total of 4 pixels is wasted on every side of windows, dialog boxes&#8230; well everything that is boxed in Vista. Luckely, <a href="http://kevintechnology.wordpress.com/2007/12/15/how-to-change-the-window-border-size-in-window-vista/">this is easily customized</a>. I personally just set the border size to 0.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/12/24/my-favourite-vista-tricks-and-tweaks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Safe way to convert UTC time to local time when databinding</title>
		<link>http://egilhansen.com/2007/10/29/safe-way-to-convert-utc-time-to-local-time-when-databinding/</link>
		<comments>http://egilhansen.com/2007/10/29/safe-way-to-convert-utc-time-to-local-time-when-databinding/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 17:43:18 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/10/29/safe-way-to-convert-utc-time-to-local-time-when-databinding/</guid>
		<description><![CDATA[After reading Scott Mitchell&#8217;s article Using Coordinated Universal Time (UTC) to Store Date/Time Values, I decided to do as he suggest and use UTC for a web application I&#8217;m building at work. All in all it is fairly easy to deal with UTC in the .NET Framwork. There is a DateTime.UtcNow you can use instead [...]]]></description>
			<content:encoded><![CDATA[<p>After reading Scott Mitchell&#8217;s article <a href="http://aspnet.4guysfromrolla.com/articles/081507-1.aspx">Using Coordinated Universal Time (UTC) to Store Date/Time Values</a>, I decided to do as he suggest and use UTC for a web application I&#8217;m building at work. All in all it is fairly easy to deal with UTC in the .NET Framwork. There is a <a href="http://msdn2.microsoft.com/en-us/library/system.datetime.utcnow.aspx">DateTime.UtcNow</a> you can use instead of the regular DateTime.Now property, and there is a <a href="http://msdn2.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx">DateTime.ToLocalTime</a> method that will convert your UTC DateTime value to the local server time zone, even taking daylight savings time in to consideration. When converting the other way, the <a href="http://msdn2.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx">DateTime.ToUniversalTime</a> method is provided.</p>
<p>With MsSQL&#8217;s getutcdate() function (instead of getdate()), just about everything is smooth sailing. The only problem I have encountered is when binding a to a ASP.NET server control. Scott suggests doing like this:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DateTime<span style="color: #000000;">&#41;</span> Eval<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;DateUpdated&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToLocalTime</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>This only works when DateUpdated is not null, which is not always the case in my application. To get around this, I created the following simple class and stuck it in my App_Code folder.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">class</span> Extensions
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// If object is a DateTime, it will convert</span>
    <span style="color: #008080; font-style: italic;">/// the DateTime to local time.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;obj&quot;&gt;&lt;/param&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;returns&gt;&lt;/returns&gt;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">object</span> ToLocalTime<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> <span style="color: #FF0000;">object</span> obj<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>obj <span style="color: #008000;">is</span> DateTime<span style="color: #000000;">&#41;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>DateTime<span style="color: #000000;">&#41;</span>obj<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToLocalTime</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">else</span>
            <span style="color: #0600FF;">return</span> obj<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>The method <span style="font-family: Courier New">ToLocalTime(this object obj)</span>uses the extension method feature in .NET 3.0, that allows you to extend the functionality of other class. Here I extend upon Object, adding a .ToLocalTime() method to it. This allows me to use it in ASP.NET server controls like this:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">Eval<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;DateUpdated&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToLocalTime</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p>This works because Eval() returns a object, which is also the reason why I did not extend a more specific class.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/10/29/safe-way-to-convert-utc-time-to-local-time-when-databinding/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updating a control in a MasterPage from a UserControl</title>
		<link>http://egilhansen.com/2007/07/05/updating-a-control-in-a-masterpage-from-a-usercontrol/</link>
		<comments>http://egilhansen.com/2007/07/05/updating-a-control-in-a-masterpage-from-a-usercontrol/#comments</comments>
		<pubDate>Thu, 05 Jul 2007 17:16:09 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/07/05/updating-a-control-in-a-masterpage-from-a-usercontrol/</guid>
		<description><![CDATA[Problem: You have a control, for example a Label, in a MasterPage that you want to update from a UserControl added to a page that resides in the MasterPage&#8217;s ContentPlaceHolder control (see figure 1).

Figure 1: From MasterPage to UserControl

I was facing this problem a few months back on a project, where I had many different [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> You have a control, for example a Label, in a MasterPage that you want to update from a UserControl added to a page that resides in the MasterPage&#8217;s ContentPlaceHolder control (see figure 1).</p>
<p><img src="/wp-content/070507-1718-updatingaco119.png" /></p>
<p><span style="color: #4f81bd; font-size: 9pt"><strong>Figure 1: From MasterPage to UserControl<br />
</strong></span></p>
<p>I was facing this problem a few months back on a project, where I had many different UserControls that was added to a limited number of pages, and all the pages had the same master page. I wanted an elegant way of updating the status label in my MasterPage while limiting the amount of redundant code. After googling around a bit, I ended up combining a few different solutions into the following.</p>
<p><span id="more-31"></span><strong>Solution:</strong> The idea is to use the event system in .NET and give each UserControl an event that the UserControl can fire whenever it wants to update the status label. Pages that host the UserControl can then subscribe to the event and update the status label on the MasterPage when the event fires.</p>
<p><strong>Here&#8217;s an overview of the solution<br />
</strong></p>
<ol>
<li>Declare a new event in the UserControl.</li>
<li>Declare a new event argument.</li>
<li>On the ASPX page, subscribe to the UserControls event and make an event handler that updates the status label on the master page.</li>
<li>Create a public property on the MasterPage for each access to the status label.</li>
</ol>
<p><strong>1: Declare a new event in the UserControl<br />
</strong>To avoid declaring the event each time I added a new UserControl to my project, I created a new class UserControlBase, which extends System.Web.UI.UserControl, and made all UserControls extend this class, instead of the default System.Web.UI.UserControl. This way I could put all the redundant UserControl code in one file, and be done with it.</p>
<pre><code>// Declare the event handler

public event EventHandler&lt;UpdateStatusEventArgs&gt; StatusLabelUpdateEvent;

</code></pre>
<pre><code>/// &lt;summary&gt;

/// Method for triggering the UpdateStatusEventArgs.

/// &lt;/summary&gt;

/// &lt;param name="message"&gt;Status message to pass to the subscribers&lt;/param&gt;

protected void UpdateStatusLabel(string message)

{

    // Copy to a temporary variable to be thread-safe.

    EventHandler&lt;UpdateStatusEventArgs&gt; temp = StatusLabelUpdateEvent;

</code></pre>
<pre><code>    if (temp != null)

        temp(this, new UpdateStatusEventArgs(message));

}

</code></pre>
<p>And here is the code for the UserControl (notice the new : UserControlBase in the class declaration):</p>
<pre><code>public partial class UserControls_UpdateStatusUserControl : UserControlBase

{

    protected void Page_Load(object sender, EventArgs e) { }

</code></pre>
<pre><code>    protected void submitButton_Click(object sender, EventArgs e)

    {

        base.UpdateStatusLabel(messageTextBox.Text);

    }

}

</code></pre>
<p><strong>2: Declare a new event argument<br />
</strong>I also needed to create an new class â€“ UpdateStatusEventArgs, which extends System.EventArgs, so the UserControls would be able to pass an message back to the ASPX page that can then update the status label.</p>
<pre><code>/// &lt;summary&gt;

/// A status label event args class.

/// &lt;/summary&gt;

public class UpdateStatusEventArgs : EventArgs

{

</code></pre>
<pre><code>    // private fields

    private string _message;

</code></pre>
<pre><code>    /// &lt;summary&gt;

    /// Create an Status Label Event Args with a string

    /// message and default type is StatusType.OK.

    /// &lt;/summary&gt;

    public UpdateStatusEventArgs() { }

</code></pre>
<pre><code>    /// &lt;summary&gt;

    /// Create an Status Label Event Args with a

    /// string message and default type is StatusType.OK.

</code></pre>
<pre><code>    /// &lt;/summary&gt;

    /// &lt;param name="message"&gt;Update message&lt;/param&gt;

    public UpdateStatusEventArgs(string message)

    {

        _message = message;

    }

</code></pre>
<pre><code>    /// &lt;summary&gt;

    /// Get/set status message

    /// &lt;/summary&gt;

    public string Message

    {

</code></pre>
<pre><code>        get { return _message; }

        set { _message = value; }

    }

}

</code></pre>
<p><strong>3: On the ASPX page, subscribe to the UserControls event.<br />
</strong>On my ASPX page I do two simple things. First I declare my master page through the <a href="http://msdn2.microsoft.com/en-us/library/ms228274.aspx">MasterPage directive</a>, just below Page directive, like so:</p>
<p>&lt;%@ MasterType VirtualPath=&#8221;~/MasterPage.master&#8221; %&gt;</p>
<p>This provides me with a strongly typed reference to my master page, which makes it a breeze to access properties and methods on it.</p>
<p>In the code behind file I subscribe to the user controls update event, and in my event handler update the status label on the master page.</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)

{

    LoadUserControl();

}

</code></pre>
<pre><code>/// &lt;summary&gt;

/// Loads user control in to the ContentPlaceHolder.

/// &lt;/summary&gt;

private void LoadUserControl()

{

    // Declare usercontrol

    UserControlBase userControl;

</code></pre>
<pre><code>    // Load correct usercontrol

    userControl =

    Page.LoadControl("~/UserControls/UpdateStatusUserControl.ascx")

    as UserControlBase;

    // Subscribe to StatusLabelUpdateEvent

    userControl.StatusLabelUpdateEvent +=

    new EventHandler&lt;UpdateStatusEventArgs&gt;(UpdateStatusLabelEvent);

</code></pre>
<pre><code>    // Add it to the page

    PlaceHolder.Controls.Add(userControl);

}

</code></pre>
<pre><code>// Event handler, used when a status label

// update request is being triggered

protected void UpdateStatusLabelEvent(object sender, UpdateStatusEventArgs e)

{

    Master.StatusLabel.Text = e.Message;

}

</code></pre>
<p><strong>4: Create a public property on the MasterPage for each access to the status label.<br />
</strong>The last thing I needed to make was a public property on the master page that returns a reference to the status label.</p>
<pre><code>public Label StatusLabel

{

    get { return statusLabel; }

}
</code></pre>
<p>That&#8217;s it!</p>
<p>Please excuse the horrible source code in this blog post, I haven&#8217;t found a good plugin to do this probably for me yet. I have created a <a href="/code/UpdatingControlOnMasterPageFromUserControl.zip">Visual Studio example project</a>, it might be easier to read the code if you just download that and view the source code from Visual Studio.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/07/05/updating-a-control-in-a-masterpage-from-a-usercontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display settings not remembered when laptop is docked</title>
		<link>http://egilhansen.com/2007/06/22/display-settings-not-remembered-when-laptop-is-docked/</link>
		<comments>http://egilhansen.com/2007/06/22/display-settings-not-remembered-when-laptop-is-docked/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 11:54:17 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/06/22/display-settings-not-remembered-when-laptop-is-docked/</guid>
		<description><![CDATA[Problem: I came across a weird problem today. Windows refused to remember the display settings on a laptop (Dell Latitude D620). Whenever I booted the computer from the docking station, the external displays screen resolution would reset itself to 1280&#215;1024, instead of the 1650&#215;1200 I specified at last boot-up.
At first I thought it was an [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> I came across a weird problem today. Windows refused to remember the display settings on a laptop (Dell Latitude D620). Whenever I booted the computer from the docking station, the external displays screen resolution would reset itself to 1280&#215;1024, instead of the 1650&#215;1200 I specified at last boot-up.</p>
<p>At first I thought it was an issue with the NVIDIA graphics driver, but it turns out it was an issue with Windows&#8217; handling of hardware profiles.</p>
<p>The laptop had previously been connected to a different docking station where the connected display had been configured to 1280&#215;1024, and Windows seemed to be remembering that setting even thought that display was not connected that docking stations anymore.</p>
<p><strong>Solution:</strong> The solution turned out to be quite simple. Windows allows you to remove faulty hardware profiles. You can even copy existing hardware profiles, so you can have different hardware profiles, one for the office docking station setup and one for the home docking station setup, for example.</p>
<p>To manage the hardware profiles, go to the <em>Control Panel</em> and choose <em>System</em>. In the <em>System Properties</em> dialog box, click on the <em>Hardware</em> tab and then on the <em>Hardware Profiles</em> button. This should bring up the <em>Hardware Profiles</em> dialog box.</p>
<p>To fix the problem I had, do the following:</p>
<ol>
<li>Remove the computer from the docking station and boot it up.</li>
<li>Navigate to your <em>Hardware Profiles</em> as described above.<br />
On a laptop, you should have to profiles already. They are created by Windows automatically â€“ <em>Undocked Profile</em> and <em>Docked Profile</em>. The <em>Undocked Profile</em> should be the current profile, as indicated by the text &#8220;(Current)&#8221; after its name.</li>
<li>Delete the <em>Docked Profile</em>.</li>
<li>Click OK a few times, closing all dialog boxes, and then shutdown the computer.</li>
<li>Re-dock the computer and boot it up.<br />
Windows will now generate a new <em>Docked Profile</em> for you.</li>
<li>Configure your display settings as you like, and try restarting Windows.<br />
Windows should now remember the display settings correctly.</li>
</ol>
<p>If you have different configurations on two or more docking stations, you can always copy an existing docked profile and thus have a unique docking profile for each docking station. If more docked profiles exist, Windows will ask you to choose one at boot time.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/06/22/display-settings-not-remembered-when-laptop-is-docked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS trick: Always show scrollbars</title>
		<link>http://egilhansen.com/2007/03/28/css-trick-always-show-scrollbars/</link>
		<comments>http://egilhansen.com/2007/03/28/css-trick-always-show-scrollbars/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 18:03:12 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/03/28/css-trick-always-show-scrollbars/</guid>
		<description><![CDATA[I worked on a site a few weeks ago where the user wanted visible scrollbars no matter how much space the content takes up on the page. Internet Explorer is happy to oblige, just put in a overflow: scroll; in your CSS and your good to go. However, Mozilla Firefox wouldn&#8217;t play ball. A bit [...]]]></description>
			<content:encoded><![CDATA[<p>I worked on a site a few weeks ago where the user wanted visible scrollbars no matter how much space the content takes up on the page. Internet Explorer is happy to oblige, just put in a <code>overflow: scroll;</code> in your <acronym title="Cascading Style Sheets">CSS</acronym> and your good to go. However, Mozilla Firefox wouldn&#8217;t play ball. A bit of Googling revealed Mozillas own implementation -<br />
<code>overflow: -moz-scrollbars-vertical;</code>.</p>
<p>So to sum up, add the following <acronym title="Cascading Style Sheets">CSS</acronym> code to your site if you want the scrollbars visible at all times:</p>
<pre><code>html {
     overflow: -moz-scrollbars-vertical;
     overflow: scroll;
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/03/28/css-trick-always-show-scrollbars/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Toggling services on/off with VBScripting</title>
		<link>http://egilhansen.com/2007/03/18/toggling-services-onoff-with-vbscripting/</link>
		<comments>http://egilhansen.com/2007/03/18/toggling-services-onoff-with-vbscripting/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 12:19:34 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/03/18/toggling-services-onoff-with-vbscripting/</guid>
		<description><![CDATA[I was tired of always having to start/stop my IIS and MSSQL services (I turn then off when I&#8217;m not developing), so I decided to write a small VBScript to help me do it. This script can be used to start/stop a number of services and their dependents, in a toggle start/stop fashion. It also [...]]]></description>
			<content:encoded><![CDATA[<p>I was tired of always having to start/stop my IIS and MSSQL services (I turn then off when I&#8217;m not developing), so I decided to write a small VBScript to help me do it. This script can be used to start/stop a number of services and their dependents, in a toggle start/stop fashion. It also allows you to specify a explicit action, either start or stop.</p>
<p>I&#8217;ve made it easy to modify it for use with other services, so have a look and let me know what you think:</p>
<p>Download: <a href="/code/StartStopServices.vbs" title="Download StartStopServices.vbs">StartStopServices.vbs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/03/18/toggling-services-onoff-with-vbscripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Legend of the BloodNinja</title>
		<link>http://egilhansen.com/2007/02/27/legend-of-the-bloodninja/</link>
		<comments>http://egilhansen.com/2007/02/27/legend-of-the-bloodninja/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 23:30:09 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/02/27/legend-of-the-bloodninja/</guid>
		<description><![CDATA[A few weeks back, I was reminiscing some of the great times I had when working at Diablo NetCafe, one of Copenhagens first gaming centers. Suddenly I remembered the sentence ?I put on my robe and wizard hat&#8221; from back when AOL was still the place to be if you were looking for some cyber [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks back, I was reminiscing some of the great times I had when working at Diablo NetCafe, one of Copenhagens first gaming centers. Suddenly I remembered the sentence ?I put on my robe and wizard hat&#8221; from back when AOL was still the place to be if you were looking for some cyber action, one guy made us all laugh when unsuspecting girls like BritneySpears14 and DirtyKate got their hands full. Luckily, <a href="http://www.google.com/search?q=i+put+on+my+robe+and+wizard+hat" title="Google search for ">Google never fails to keep good memories alive</a>.</p>
<p>Here is probably the most famous chat log ever &#8211; behold the legend of the BloodNinja:</p>
<blockquote><p><strong>bloodninja</strong>: Baby, I been havin a tough night so treat me nice aight?<br />
<strong>BritneySpears14</strong>: Aight.<br />
<strong>bloodninja</strong>: Slip out of those pants baby, yeah.<br />
<strong>BritneySpears14</strong>: I slip out of my pants, just for you, bloodninja.<br />
<strong>bloodninja</strong>: Oh yeah, aight. Aight, I put on my robe and wizard hat.<br />
<strong>BritneySpears14</strong>: Oh, I like to play dress up.<br />
<strong>bloodninja</strong>: Me too baby.<br />
<strong>BritneySpears14</strong>: I kiss you softly on your chest.<br />
<strong>bloodninja</strong>: I cast Lvl. 3 Eroticism. You turn into a real beautiful woman.<br />
<strong>BritneySpears14</strong>: Hey&#8230;<br />
<strong>bloodninja</strong>: I meditate to regain my mana, before casting Lvl. 8 Cock of the Infinite.<br />
<strong>BritneySpears14</strong>: Funny I still don&#8217;t see it.<br />
<strong>bloodninja</strong>: I spend my mana reserves to cast Mighty F*ck of the Beyondness.<br />
<strong>BritneySpears14</strong>: You are the worst cyber partner ever. This is ridiculous.<br />
<strong>bloodninja</strong>: Don&#8217;t f*ck with me bitch, I&#8217;m the mightiest sorcerer of the lands.<br />
<strong>bloodninja</strong>: I steal yo soul and cast Lightning Lvl. 1,000,000 Your body explodes into a fine bloody mist, because you are only a Lvl. 2 Druid.<br />
<strong>BritneySpears14</strong>: Don&#8217;t ever message me again you piece of ****.<br />
<strong>bloodninja</strong>: Robots are trying to drill my brain but my lightning shield inflicts DOA attack, leaving the robots as flaming piles of metal.<br />
<strong>bloodninja</strong>: King Arthur congratulates me for destroying Dr. Robotnik&#8217;s evil army of Robot Socialist Republics. The cold war ends. Reagan steals my accomplishments and makes like it was cause of him.<br />
<strong>bloodninja</strong>: You still there baby? I think it&#8217;s getting hard now.<br />
<strong>bloodninja</strong>: Baby?</p></blockquote>
<p>I just love the witty reply from BritneySpears14 after BloodNinja casts his level 8 &#8220;Cock of the Infinite&#8221; &#8211; good times.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/02/27/legend-of-the-bloodninja/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Daily Show on Danish television</title>
		<link>http://egilhansen.com/2007/02/26/daily-show-on-danish-television/</link>
		<comments>http://egilhansen.com/2007/02/26/daily-show-on-danish-television/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 22:17:29 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[TV]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/02/26/daily-show-on-danish-television/</guid>
		<description><![CDATA[My favorite TV talk show has finally arrived on Danish television. It&#8217;s the Daily Show with Jon Stewart from Comedy Central, where the latest news from the US (and sometimes, the rest of the world), gets presented in a satiric and often ironic way. It&#8217;s fantastic and intelligent humor, highly recommendable. With nine Emmys won [...]]]></description>
			<content:encoded><![CDATA[<p>My favorite TV talk show has finally arrived on Danish television. It&#8217;s the Daily Show with Jon Stewart from Comedy Central, where the latest news from the US (and sometimes, the rest of the world), gets presented in a satiric and often ironic way. It&#8217;s fantastic and intelligent humor, highly recommendable. With nine Emmys won since its start in 1996 and great taglines like &#8220;<em>When news breaks, we fix it</em>&#8220;, &#8220;<em>More people get their news from the Daily Show with Jon Stewart&#8230; Than probably should</em>&#8220;, and &#8220;<em>Third rate reporters giving the first degree the second news happens</em>&#8221; you can&#8217;t go wrong.</p>
<p>The show can be watched on DR2 Monday through Thursday at 23:30.</p>
<ul>
<li><a href="http://www.dr.dk/dr2/the+daily+show">DR2 press release (Danish)</a></li>
<li><a href="http://www.imdb.com/title/tt0115147/">The Daily Show on IMDB</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/02/26/daily-show-on-danish-television/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSUS getting a facelift with version 3.0</title>
		<link>http://egilhansen.com/2007/02/09/wsus-getting-a-facelift-with-version-30/</link>
		<comments>http://egilhansen.com/2007/02/09/wsus-getting-a-facelift-with-version-30/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 12:22:00 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Administrating]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/02/09/wsus-getting-a-facelift-with-version-30/</guid>
		<description><![CDATA[After working with both SUS, WSUS 1 and 2 over the years and always feeling somewhat limited and tied down, it looks like the guys at Microsoft are finally giving WSUS a major overhaul, essentially giving administrators more options and control. Everything from a new revamped installation wizard to a new MMC console (instead of [...]]]></description>
			<content:encoded><![CDATA[<p>After working with both SUS, WSUS 1 and 2 over the years and always feeling somewhat limited and tied down, it looks like the guys at Microsoft are finally giving <abbr title="Windows Server Update Service">WSUS</abbr> a major overhaul, essentially giving administrators more options and control. Everything from a new revamped installation wizard to a new <abbr title="Microsoft Management Console">MMC</abbr> console (instead of the sluggish web interface in previous versions), nesting of computer groups and a new reporting service should make patch management of Microsoft products more enjoyable. Over at TechRepublic Joshua Hoskins have <a href="http://articles.techrepublic.com.com/5100-1035_11-6157154.html" title="Take full advantage the new and improved Microsoft Windows Server Update Services">good rundown of what&#8217;?s new in <abbr title="Windows Server Update Service">WSUS</abbr> 3.0</a>, which should be out of the beta stages soon (currently beta 2.0). If you want to try out the new version of WSUS, make your way over to Microsofts <a href="http://www.microsoft.com/windowsserversystem/updateservices/" title="Official website for Windows Server Update Service">Windows Server Update Service page</a> for all the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/02/09/wsus-getting-a-facelift-with-version-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting excited about LINQ</title>
		<link>http://egilhansen.com/2007/02/08/getting-excited-about-linq/</link>
		<comments>http://egilhansen.com/2007/02/08/getting-excited-about-linq/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 20:48:02 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/02/08/getting-excited-about-linq/</guid>
		<description><![CDATA[Today I attended a very fascinating two hour lecture at DIKU where Mads Torgersen (Program Manager at Microsoft) talked about LINQ and how it works. He especially focused on the different ideas and technologies that Microsoft uses under the hood to make it less of a pain for the rest of us when working with [...]]]></description>
			<content:encoded><![CDATA[<p>Today I attended a very fascinating two hour lecture at <abbr title="The Department of Computer Science, University of Copenhagen">DIKU</abbr> where Mads Torgersen (Program Manager at Microsoft) talked about <abbr title="Language Integrated Query">LINQ</abbr> and how it works. He especially focused on the different ideas and technologies that Microsoft uses under the hood to make it less of a pain for the rest of us when working with data. One of the things that he focused a great deal on was how principles from <a href="http://en.wikipedia.org/wiki/Functional_programming" title="More about functional programming over at Wikipedia">functional programming</a> are being introduced into the C# and the .NET framework.</p>
<p>A funny side note: I was sitting next to a professors who teaches a course on functional programming that they make every first year student take, and he said numerous times that <span style="font-style: italic">&#8220;this is a great advertisement for my course&#8221;</span>, and I do understand why he is was excited. I remember back when I was dragged kicking and screaming through that course, wondering why I needed to learn this weird kind of programming that wasn&#8217;t even used in general practice, but now, all of a sudden, this guy from Microsoft is typing in lambda expressions in Visual Studio on the projector, God knows I never thought I would see a lambda expression again after that course <img src='http://egilhansen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Back home from the university I goggled around a bit and found two interesting videos featuring another Dane, <a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg" title="Anders Hejlsberg at Wikipedia">Anders Hejlsberg</a> (Chief Architect of C# at Microsoft). In <a href="http://channel9.msdn.com/Showpost.aspx?postid=114680" title="Anders Hejlsberg on LINQ at Channel 9">the first video</a> Anders gives an introduction to benefits <abbr title="Language Integrated Query">LINQ</abbr> will give you as a programmer using easy to understand code examples, and in <a href="http://blogs.msdn.com/charlie/archive/2007/01/26/anders-hejlsberg-on-linq-and-functional-programming.aspx" title="Anders Hejlsberg on LINQ and Functional Programming">the second video</a> he talks more theoretically about the problem that <abbr title="Language Integrated Query">LINQ</abbr> solves and also gets into what capabilities functional programming will bring to the table down the road. Both videos are well worth the time.</p>
<p>More information can be found over at <a href="http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx" title="The LINQ Project">The LINQ Project page</a> on the MSDN network.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/02/08/getting-excited-about-linq/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A look at remote support software</title>
		<link>http://egilhansen.com/2007/02/07/a-look-at-remote-support-software/</link>
		<comments>http://egilhansen.com/2007/02/07/a-look-at-remote-support-software/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 18:46:01 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Administrating]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/02/07/a-look-at-remote-support-software/</guid>
		<description><![CDATA[While doing some research on remote support software at work I was pointed to a great piece of software called TeamViewer. It basically allows you to remote control a computer anywhere, as long as it is connected to the Internet, and it&#8217;s even free for non commercial use.
It&#8217;s quite simple, ask the person you need [...]]]></description>
			<content:encoded><![CDATA[<p>While doing some research on remote support software at work I was pointed to a great piece of software called <a href="http://www.teamviewer.com/" title="TeamViewer.com">TeamViewer</a>. It basically allows you to remote control a computer anywhere, as long as it is connected to the Internet, and it&#8217;s even free for non commercial use.</p>
<p>It&#8217;s quite simple, ask the person you need to support to download the <a href="http://download.teamviewer.com/download/TeamViewerQS.exe" title="Download Customer module">Customer module</a> and run it and have them give you the ID and password it displays.<br />
Then you download the <a href="http://download.teamviewer.com/download/TeamViewer_Setup.exe" title="Download Supporter module">Supporter module</a> and enter the ID and password he/she gave you and you can now show instead of having to explain.</p>
<p>The only limitation is that a support session can only last 30 minutes the you have to reconnect.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/02/07/a-look-at-remote-support-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake dueling guide</title>
		<link>http://egilhansen.com/2007/01/28/quake-dueling-guide/</link>
		<comments>http://egilhansen.com/2007/01/28/quake-dueling-guide/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 16:43:16 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Quake]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/01/28/quake-dueling-guide/</guid>
		<description><![CDATA[Back in October 2005 when Quake 4 was about to be released I decided to write a guide to dueling in Quake. A few years back I was dueling on a fairly high level (at least by Danish standards) in Quake 3 and besides having some experience to share I also though an article like [...]]]></description>
			<content:encoded><![CDATA[<p>Back in October 2005 when <a href="http://www.idsoftware.com/games/quake/quake4/" title="Quake 4 at id Software">Quake 4</a> was about to be released I decided to write a guide to dueling in Quake. A few years back I was dueling on a fairly high level (at least by Danish standards) in <a href="http://www.idsoftware.com/games/quake/quake3-arena/" title="Quake3Arena at id Software">Quake 3</a> and besides having some experience to share I also though an article like that would help build a good Quake dueling community in Denmark again by helping aspiring Quakers get some tools to work on their game and not give up right away.</p>
<p>I actually never started playing Quake again when Quake 4 was released, largely due to time constraints but definitely also because my computer couldn&#8217;t deliver the performance needed to run the game decently, so I&#8217;m unsure how much my article actually helped.</p>
<p>The article was originally posted on <a href="http://xplayn.com/" title="Visit XplayN">XplayN.com</a> &#8211; the biggest Counter Strike community back then, but since it&#8217;s nowhere to be found now, I thought I would repost it here. Unfortunately it&#8217;s only in Danish, but I hope some of you might find it an interesting read.</p>
<p><span id="more-18"></span></p>
<h4>Introduktion</h4>
<p>Denne artikel er t&aelig;nkt som en grundl&aelig;ggede introduktion til 1on1 i Quake. Teknikkerne beskrevet her er ikke ment som en kontrast til hvad man skal kunne for at blive god i f.eks. Counter Strike, der er sikkert en del af disse punkter som ogs&aring; er gode at have i baghoved n&aring;r man spiller <acronym title="Counter Strike">CS</acronym>.</p>
<p>Ideen er, at artiklen skal give alle de (forh&aring;bentligt) mange, som har lyst til at pr&oslash;ve 1on1 i Quake 4, en chance. Lad det v&aelig;re sagt med det samme &#8211; det kr&aelig;ver meget arbejde at blive god til 1on1 i Quake. Dette er en liste af grundl&aelig;ggede egenskaber man skal have, og den er lavet, for at give folk en ide om hvor de skal tage fat for at blive bedre.</p>
<p>Er du god til at spille <acronym title="Counter Strike">CS</acronym> eller andre 3D skydespil, b&oslash;r du med lidt tr&aelig;ning kunne klare dig OK i Quake. Det hj&aelig;lper dog klart at have en tr&aelig;ningspartner eller to, som er p&aring; samme niveau som dig. Man kan l&aelig;re meget af en ordentlig r&oslash;vfuld, men det er trods alt lettere at arbejde p&aring; specifikke ting i sit spil, hvis man er med i kampen.</p>
<h4>Map kontrol</h4>
<p>N&oslash;glen til at vinde kampe i Quake er map kontrol (i Quake bliver en bane kaldt for et &quot;map&quot;). At have map kontrol vil sige at du har kontrol over de v&aelig;sentlige powerups (et powerup er en ting som ligger p&aring; at fast sted p&aring; banen og som giver spilleren der samle det op en bonus, f.eks. mere liv eller mere armor) p&aring; banen, f.eks. Red Armor som giver +100 til dit armor, Yellow Armor som giver +50 til dit armor og Mega Health som giver +100 til dit liv. Det betyder ogs&aring; at du kan forhindre modstanderen i at f&aring; specifikke v&aring;ben, og du sikrer dig at det er dig som v&aelig;lger hvorn&aring;r der skal v&aelig;re en konfrontation, og hvorn&aring;r der ikke skal.</p>
<h4>Timing</h4>
<p>En af de vigtigste egenskaber at besidde, er evnen til at holde styr p&aring; to til fire forskellige powerups i l&oslash;bet af en kamp. Det lyder simpelt, men er ganske sv&aelig;rt at mestre (kun en ganske lille procent af Quake 3 spillerne var i stand til at mestre dette til perfektion).</p>
<p>I teorien er det simpelt. Du har en lille klokke i h&oslash;jre hj&oslash;rne, som viser hvor lang tid der er g&aring;et af kampen. Den kigger du p&aring; n&aring;r du f.eks. samler en Red Armor op, og l&aelig;gger s&aring; 25 sekunder til den tid. Nu ved du hvorn&aring;r den n&aelig;ste Red Armor kommer. Nu mangler du bare at time de tre-fire andre powerups der er p&aring; banen ogs&aring;, s&aring; er du godt p&aring; vej.</p>
<p>At have timet en powerup er en k&aelig;mpe fordel. Hvis din modstander har en god ide om, hvorn&aring;r en powerup respawner (at respawne betyder blot at en powerup/et v&aring;ben/en spiller bliver gendannet/genopst&aring;r. F.eks. respawner en Red Armor 25 sekunder efter den blev samlet op sidste gang og en spiller respawner efter at han/hun er blevet dr&aelig;bt), vil han ogs&aring; automatisk kunne antage, at du opholder dig i omr&aring;det omkring denne, og vil ofte kunne udnytte dette til at overraske dig. Har din modstander har timet powerup&#8217;en pr&aelig;cist, vil han ofte kunne v&aelig;lge det helt perfekte tidspunkt at angribe dig p&aring;, s&aring; du er ude af balance, og han b&aring;de f&aring;r dr&aelig;bt dig og snuppet powerup&#8217;en p&aring; en gang. At powerups ofte er placeret i udsatte positioner, som er sv&aelig;re at forsvare, g&oslash;r det heller ikke lettere at st&aring; og campe (at campe er et udtryk der betyder at en spiller har valgt at &quot;sl&aring; lejer&quot; et sted p&aring; banen for gemme sig for eller overraske sin modstander) og vente p&aring; at den respawner.</p>
<p>Alts&aring;, &oslash;v dig i at time powerups. Start med at g&aring; efter at time en powerup i en hel kamp. Det i sig selv er et stort skridt. &Atilde;?&Euml;Sv dig i at holde timingen, selv om din modstander f&aring;r din powerup en gang i mellem. Selv om du misser en powerup eller to gange i tr&aelig;k, b&oslash;r du stadig have en god ide om, hvorn&aring;r den kommer igen. N&aring;r dette er p&aring; plads, s&aring; udvid din timing til to items, og s&aring; videre.</p>
<h4>Placering</h4>
<p>At placerer sig korrekt p&aring; banen i alle situationer er et must. Dermed ikke sagt at du skal finde det bedste sted at campe, fordi det vinder man meget sj&aelig;ldent kampe i Quake p&aring;. Din modstander vil lynhurtigt opdage hvis du altid st&aring;r det samme sted og gemmer dig, og s&aring; er det pludselig ham som overrasker dig.</p>
<p>Generelt er positioner hvor du er placeret h&oslash;jere end din modstander bedst. Positioner hvor du har st&oslash;rre muligheder for at bev&aelig;ge dig rundt, er bedre end en lang smal gang. Positioner hvor du har muligheden for at stikke af, hvis du skulle blive s&aring;ret, er ogs&aring; bedre end positioner hvor du bliver n&oslash;dt til at k&aelig;mpe, ind til du enten har skr&aelig;mt din modstander v&aelig;k, dr&aelig;ber ham, eller selv d&oslash;r.</p>
<p>At vide hvordan man skal placere sig, er et sp&oslash;rgsm&aring;l om at kende banen indg&aring;ende, vide hvilke v&aring;ben man har til r&aring;dighed, og ikke mindst hvilke v&aring;ben din modstander har.</p>
<h4>V&aring;ben</h4>
<p>I Quake er der ikke et v&aring;ben som er bedste i alle situationer, det handler i den grad om hvad din modstander har og jeres position p&aring; banen og placering i forhold til hinanden. St&aring;r du og din modstander f.eks. overfor hinanden p&aring; et stort fladt omr&aring;de med en god afstand imellem jer, s&aring; hj&aelig;lper det ikke meget at du st&aring;r med en Rocket Launcher (en Rocket Launcher skyder langsomt flyvende projektiler, som giver stor skade i det omr&aring;de de ramme) i h&aring;nden, hvis han har en Lighting Gun (en Lighting Gun skyder en slags str&oslash;mstr&aring;le af sted, som har en begr&aelig;nset r&aelig;kkevidde og kun giver skade lige der hvor den rammer) eller en Railgun (en Railgun skyder projektiler (kaldet Railslugs) af sted med ubegr&aelig;nset r&aelig;kkevidde som giver stor skade lige der hvor de ramme. En Railgun tager dog lang tid om at lade mellem hvert skud). S&aring; er det bedre at stikke raketten mellem benene og smutte <img src='http://egilhansen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Har du derimod fanget din modstander med en Railgun i h&aring;nden i en t&aelig;t korridor, s&aring; er han d&oslash;d p&aring; 1-2 sekunder hvis du ellers kan ramme med dine raketter. Er situationen modsat, er det ikke specielt sjovt at st&aring; over for en Railgun, da man ofte n&aring;r at blive sl&aring;et halvt ihjel, inden man n&aring;r ind p&aring; livet af sin modstander og kan g&oslash;re skade.</p>
<p>Generelt b&oslash;r man undg&aring; at blive fanget af sin modstander i t&aelig;t bebyggelse med v&aring;ben som ikke har splashdamage (splashdamage referer til effekten af projektiler som eksploder n&aring;r de rammer og derved giver skade til b&aring;de det punkt de rammer samt omr&aring;det omkring dette) og langsom lade tid &#8211; f.eks. Railgun. En undtagelse er Shotgun&#8217;en, som hverken har splashdamage eller speciel hurtig &quot;rate of fire&quot;, men til geng&aelig;ld giver et ordentligt dr&oslash;n i s&aelig;kken, hvis man s&aelig;tter alle kuglerne i modstanderen. Shotgun&#8217;en kan dog v&aelig;re sv&aelig;r at mestre.</p>
<p>I kategorien &quot;midt i mellem&quot; v&aring;ben, er Hyperblaster, Nailgun og Lighting Gun. Alle tre v&aring;ben er hverken udtalte n&aelig;rkamps v&aring;ben, og kan heller ikke klare sig p&aring; meget lang afstand mod en Railgun, men kan ofte stadig give en del skade i alle situationer.</p>
<p>Alts&aring; &#8211; t&aelig;nk over hvad for et v&aring;ben du har i h&aring;nden n&aring;r du bev&aelig;ger dig rundt p&aring; banen.</p>
<h4>L&aelig;s din modstander og overrask ham</h4>
<p>Det hj&aelig;lper dig ikke meget at have alle v&aring;ben, og timet alle powerups, hvis det er din modstander der f&aring;r l&oslash;snet det f&oslash;rste skud hver eneste gang i m&oslash;der hinanden. Bliver du ramt af et railslug, en raket eller lignende, s&aring; har du allerede mistet de f&oslash;rste 66 armor points, og 33 health points (eller 100 health hvis du ikke havde noget armor), og s&aring; er i sandsynligvis stort set lige hvad ang&aring;r health og armor. Da du oven i k&oslash;bet ofte lige skal orientere dig (med mindre du har set hvor modstanderen sk&oslash;d fra), er chancen for at din modstander f&aring;r lov at s&aelig;tte den n&aelig;ste salve i dig, inden du overhoved har skudt p&aring; ham en eneste gang, rimelig stor.<br />
Derfor, t&aelig;nk dig om. Hvis du ikke har en klar ide om hvor din modstander er, s&aring; g&aring; forsigtigt frem, og v&aelig;r p&aring;passelige med ikke at blive overrasket.</p>
<p>Har du derimod en god ide om hvor din modstander er, s&aring; er det bestemt ingen skam at lave et lille bagholdsangreb &#8211; husk, den der skyder f&oslash;rst vinder ofte en konfrontation.</p>
<p>Generelt, har du l&aelig;st din modstander, ved hvor han er og hvor han er p&aring; vej hen, s&aring; ligger alle kortene i dine h&aelig;nder. Du kan v&aelig;lge om du vil tage en konfrontation med ham, eller du kan undg&aring; ham og samle mere armor/health og v&aring;ben sammen.</p>
<h4>Speed, speed, speed</h4>
<p>Endnu en vigtig ting at mestre for at kunne overraske sin modstander er fysikken i Quake. Dette punkt h&aelig;nger meget sammen med at l&aelig;re banerne at kende &#8211; n&aring;r du kender en bane indg&aring;ende, kender du alle de sm&aring; smutveje, trickjumps og lignende, og vil meget hurtigere kunne bev&aelig;ge dig rundt. Jo hurtigere du er, jo l&aelig;ngere tid vil du have til at placerer dig i favorable positioner, du vil have lettere ved at stikke af fra din modstander, og du vil ikke mindst kunne overraske din modstander og f&aring; det f&oslash;rste skud ind.</p>
<p>Det er en r&aelig;kke forskellige teknikker i Quake, som g&oslash;r dig i stand til at bev&aelig;ge dig i &quot;hurtigere end l&oslash;be tempo&quot; eller komme steder man normalt ikke kan. Den vigtigste af disse er strafejumping, hvor du i Quake 3 kunne opn&aring;r noget der ligner dobbelt hastighed, og dermed hoppe over steder hvor det ellers ikke normalt var muligt. En god gennemgang af den teknik, og et par andre, kan findes i <a href="http://www.quake3world.com/forum/viewtopic.php?t=11829" title="DooMer's guide til Quake 4">DooMer&#8217;s guide til Quake 4</a>.</p>
<h4>Varier dit spil</h4>
<p>Husk, der er to spillere i kampen, og din modstander l&aelig;re ogs&aring; af sine fejl. Varier derfor dit spil, lad v&aelig;re med at st&aring; og vente det samme sted ved Red Armor, lad v&aelig;re med at l&oslash;be samme rute rundt p&aring; banen, n&aring;r du st&oslash;vsuger den for armor og health.</p>
<h4>Tilpas dig kampen</h4>
<p>De letteste frags du f&aring;r i Quake, er dem hvor modstanderen lige er respawnet efter du har nakket ham. Han har ingen v&aring;ben, intet armor, og det skal man &oslash;ve sig i at udnytte. Jo flere frags du kan n&aring; at f&aring; inden han kommer ind i sin rytme igen og f&aring;r samlet v&aring;ben og armor sammen, jo bedre. Bliver du derimod fragget, s&aring; nytter det ikke noget at styrte hovedkulds ind i hoved p&aring; din modstander igen, med mindre du ved at han har meget lidt liv tilbage, for s&aring; bliver du bare nakket igen. Hold lidt igen, f&aring; skrabet et par v&aring;ben og noget armor sammen, og s&aring; kan du begynde at spille lidt mere aggressivt igen.</p>
<h4>Checkliste</h4>
<p>Her er en kort checkliste I kan bruge, hvis I f&oslash;ler at I konstant taber:</p>
<ul>
<li>Hvor mange powerups fik du? Hvor mange fik din modstander?<br />
Hvis du f&oslash;ler at du sagtens kunne klare din modstander i en direkte konfrontation, men ofte tabte alligevel, er det m&aring;ske fordi han bare havde samlet flere powerups op.</li>
<li>Hvem havde sk&oslash;d f&oslash;rst?<br />
Var det stort set altid din modstander som fik det f&oslash;rste skud ind, s&aring; kunne noget tyde p&aring;, at han har haft en god ide om hvor du har v&aelig;ret det meste af kampen, og blot har st&aring;et og ventet hver gang du kom dr&oslash;nende rundt om hj&oslash;rnet. Det er m&aring;ske ikke den mest prangende m&aring;de han vinder kampen p&aring;, men det er ti gange lettere at st&aring; og sigte mod en d&oslash;r, og s&aring; s&aelig;tte et par kuler modstanderen n&aring;r han kommer igennem, end det er for ham som kommer igennem d&oslash;ren at ramme sin modstander. Og som man siger, vinderen har altid ret.<br />
Bliver du skudt fra det samme sted hver gang, s&aring; L&Atilde;?&acirc;&not;&nbsp;R af det, og overrask modstanderen n&aring;r han st&aring;r der for tiende gang.</li>
<li>Tabte du selv om du b&aring;de havde l&aelig;st din modstander, og havde f&aring;et rigeligt med powerups, ja s&aring; er det ofte bare tale om, at din modstander har v&aelig;ret bedre til at v&aelig;lge de rigtige v&aring;ben i de konfrontationer i har haft, og sandsynligvis ogs&aring; v&aelig;ret bedre til at bruge dem. En vigtig ting at huske er, at din pr&aelig;cision med de forskellige v&aring;ben i den grad afh&aelig;nger af din modstander. At du s&aelig;tter 80% af alle din railslugs n&aring;r du t&aelig;ver din lillebror, er ikke ensbetydende med at du kan g&oslash;re det samme mod Fatal1ty. To ligev&aelig;rdige modstandere vil ofte ramme d&aring;rligere mod hinanden end mod d&aring;rligere spillere.</li>
<li>Blev du konstant spawnfragget?<br />
T&aelig;nk over hvordan du agere n&aring;r du er blevet fragget &#8211; taber du hovedet og styrter efter din modstander, eller holder du igen og f&aring;r samlet lidt v&aring;ben og armor sammen. En kamp kan hurtigt vende, det tager ikke mere end et minut at skrabe 10 frags sammen, s&aring; der er ikke nogen grund til at have for travlt efter man er blevet nakket.</li>
</ul>
<p>Med overst&aring;ende i bagh&aring;nden er det bare med at komme i gang med at tr&aelig;ne, happy fragging.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/01/28/quake-dueling-guide/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Egil.dk&#8217;s style</title>
		<link>http://egilhansen.com/2007/01/28/egildks-style/</link>
		<comments>http://egilhansen.com/2007/01/28/egildks-style/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 13:24:19 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Egil.dk]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/01/28/egildks-style/</guid>
		<description><![CDATA[In the spirit of sharing code, I thought I&#8217;d publish my custom style sheet I&#8217;m using to customize the K2 theme. So far it&#8217;s pretty basic, but I guess it will evolve with time.
For this style sheet to make any sense on your blog, you obviously need the K2 theme. Then you need to create [...]]]></description>
			<content:encoded><![CDATA[<p>In the spirit of sharing code, I thought I&#8217;d publish my custom style sheet I&#8217;m using to customize the K2 theme. So far it&#8217;s pretty basic, but I guess it will evolve with time.</p>
<p>For this style sheet to make any sense on your blog, you obviously need the <a href="http://getk2.com/" title="K2 theme">K2 theme</a>. Then you need to create a new directory (for example &#8220;egil&#8221;) in <code>/wp-content/themes/k2/styles/</code>, and copy the <a href="/wp-content/themes/k2/styles/egil/egil.css" title="Download egil.css">egil.css</a> file to it.<br />
After that you need to create a sub directory in <code>/wp-content/themes/k2/styles/[style dir]/</code> called <code>images</code> and copy <a href="/wp-content/themes/k2/styles/egil/images/Crop_of_Solomon_Islands_Sunset_II_by_Daviegunn.jpg" title="Download the header image">the header image</a> there.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/01/28/egildks-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Windows XP SP1 to SP2 gone bad</title>
		<link>http://egilhansen.com/2007/01/28/upgrading-windows-xp-sp1-to-sp2-gone-bad/</link>
		<comments>http://egilhansen.com/2007/01/28/upgrading-windows-xp-sp1-to-sp2-gone-bad/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 12:20:51 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/01/28/upgrading-sp1-to-sp2-gone-bad/</guid>
		<description><![CDATA[I had to reinstall my laptop the other day and since the only Windows XP CD I could find at work was one with SP1, I just installed that thinking it would be a smooth ride upgrading to SP2 once I had it up and running.
As you have probably guessed it didn&#8217;t go as planed. [...]]]></description>
			<content:encoded><![CDATA[<p>I had to reinstall my laptop the other day and since the only Windows XP CD I could find at work was one with SP1, I just installed that thinking it would be a smooth ride upgrading to SP2 once I had it up and running.</p>
<p>As you have probably guessed it didn&#8217;t go as planed. Every time I started the SP2 installation, it would get stuck when it reached <em>&#8220;Checking Product Key&#8221;</em>. After some googling I stumbled across the following solution mailed to another unlucky guy by Microsoft Support, which thankfully worked for me as well.</p>
<h4>Fix for Service Pack 2 installation stuck at &#8220;Checking Product Key&#8221;</h4>
<ol>
<li>Please go into the CMD prompt (Start/Run &#8211;&gt; <code>cmd.exe</code>)</li>
<li>Then type <code>cd /d %windir%\inf</code> and make sure we are in that directory.</li>
<li>Then type <code>ren oem*.inf oem*.old</code>, it will go back to the prompt after giving you some error (do not worry about it).</li>
<li>Then type <code>ren oem*.pnf oem*.old1</code>, it will go back to the prompt after giving you some error (Do not worry about it).</li>
<li>Then goto Start/Run and type <code>"%windir%\inf"</code> and you will see the files in the folder.</li>
<li>Then find the file by name <code>INFCACHE.1</code> and move it to the desktop (or another place outside the Windows folder) from c:\windows\inf.</li>
<li>Close all windows and reboot the computer to safe mode and start the installation of SP2 and it should go fine.</li>
</ol>
<p>Microsoft, you owe me three hours&#8230;</p>
<p class="MsoNormal">Update: I originally forgot to mention why this happens. When SP2 tries to validate your Windows key using the infamous Windows Genuine Advantage, it can fail if OEM drivers have been installed. So to avoid this problem completely, simply upgrade to SP2 right away after the initial installation of Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/01/28/upgrading-windows-xp-sp1-to-sp2-gone-bad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hello world from Egil.dk</title>
		<link>http://egilhansen.com/2007/01/22/hello-world-from-egildk/</link>
		<comments>http://egilhansen.com/2007/01/22/hello-world-from-egildk/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 09:07:51 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[Egil.dk]]></category>

		<guid isPermaLink="false">http://www.egil.dk/2007/01/22/hello-world-from-egildk/</guid>
		<description><![CDATA[After thinking about getting a web log for a long time (I even started coding one my self a few times), I decided to take the easy road and just do the &#8220;Famous 5-Minute Install&#8221; of WordPress, pick a theme that seemed reasonable and be done with it. Of course I couldnâ€™t resist spicing things [...]]]></description>
			<content:encoded><![CDATA[<p>After thinking about getting a web log for a long time (I even started coding one my self a few times), I decided to take the easy road and just do the &#8220;<a href="http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install" title="WordPress' Famous 5-Minute Install">Famous 5-Minute Install</a>&#8221; of WordPress, pick a theme that <a href="http://getk2.com/" title="K@">seemed reasonable</a> and be done with it. Of course I couldnâ€™t resist spicing things up a little so I cropped one of my <a href="http://www.deviantart.com/deviation/27646771/" title="Solomon Islands Sunset II by ~Daviegunn on deviantART">favorite background images</a> and put it up in the header and moved the text there around a bit as well. I&#8217;ll probably keep playing around with the layout and styling when I have the time &#8211; I might even do a complete theme myself one day if time allows.</p>
<p>So what can you expect on this site. You can expect to read my rants on everything I think I have something (intelligent) to rant about, I&#8217;ll probably post more or less useful tips about things &#8211; most often topics related to programming or computers in general, and maybe even an article once in a while that goes deeper in to a topic or present something I have created that I want to share or just get feedback on.</p>
<p>So enjoy your stay and welcome to Egil.dk.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2007/01/22/hello-world-from-egildk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
