<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://bloggingabout.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rick van den Bosch - Blog : HowTo</title><link>http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx</link><description>Tags: HowTo</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>How to add Next and Previous buttons to Twitter Bootstrap tabs</title><link>http://bloggingabout.net/blogs/rick/archive/2013/01/16/how-to-add-next-and-previous-buttons-to-twitter-bootstrap-tabs.aspx</link><pubDate>Wed, 16 Jan 2013 09:02:56 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578267</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578267</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2013/01/16/how-to-add-next-and-previous-buttons-to-twitter-bootstrap-tabs.aspx#comments</comments><description>  &lt;p&gt;Just a quickie today: when working with &lt;a href="http://twitter.github.com/bootstrap" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt; &lt;a href="http://twitter.github.com/bootstrap/javascript.html#tabs" target="_blank"&gt;tabs&lt;/a&gt;, like I am in my ASP.NET MVC 4 project, you might want to add Next and Previous buttons on the tabs to create something of a Wizard. Here’sa step by step overview of how I did this:&lt;/p&gt;  &lt;p&gt;Add an ID to all the ListItem elements that are used for the tab navigation. For instance:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&amp;lt;ul &lt;span class="kwrd"&gt;class&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;nav nav-tabs&amp;quot;&lt;/span&gt; id=&lt;span class="str"&gt;&amp;quot;myTab&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;li&amp;gt;&amp;lt;a href=&lt;span class="str"&gt;&amp;quot;#example&amp;quot;&lt;/span&gt; data-toggle=&lt;span class="str"&gt;&amp;quot;tab&amp;quot;&lt;/span&gt; id=&lt;span class="str"&gt;&amp;quot;xmpl&amp;quot;&lt;/span&gt;&amp;gt;Example&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
    ...
&amp;lt;/ul&amp;gt;&lt;/pre&gt;
Add a button you would like to use to activate the Example tab 

&lt;p&gt;In the onclick, call the ShowTab JavaScript function with the id of the ListItem for the Example tab (which is ‘xmpl’ in this example) 
  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;The ShowTab function is simple: &lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; ShowTab(tabname) { 
    $(&lt;span class="str"&gt;&amp;#39;#&amp;#39;&lt;/span&gt; + tabname).tab(&lt;span class="str"&gt;&amp;#39;show&amp;#39;&lt;/span&gt;); 
} &lt;/pre&gt;


&lt;p&gt;Hope this helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578267" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/jQuery/default.aspx">jQuery</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Twitter+Bootstrap/default.aspx">Twitter Bootstrap</category></item><item><title>Debugging JavaScript with Visual Studio in an ASP.NET MVC 4 application</title><link>http://bloggingabout.net/blogs/rick/archive/2012/12/19/debugging-javascript-with-visual-studio-in-an-asp-net-mvc-4-application.aspx</link><pubDate>Wed, 19 Dec 2012 05:27:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578220</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>1</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578220</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/12/19/debugging-javascript-with-visual-studio-in-an-asp-net-mvc-4-application.aspx#comments</comments><description>&lt;p&gt;When debugging JavaScript in an ASP.NET MVC (4) application, it is not always enough to uncheck the &amp;#39;Disable script debugging&amp;#39; checkboxes under &amp;#39;Tools&amp;#39; - &amp;#39;Internet Options&amp;#39; - &amp;#39;Advanced&amp;#39; - &amp;#39;Browsing&amp;#39;. JavaScript inside a Razor view (a cshtml file) cannot be debugged from Visual Studio. To debug your JavaScript, move it to a separate .js file and link to that file from your Razor view. This way, breakpoints set in the JavaScript will be hit and you can debug from Visual Studio.&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;Disclaimer: I know about the F12 Developer Tools, Firebug and all the other possibilities we have to debug JavaScript. This post is about getting JavaScript debugging to work with Visual Studio and breakpoints set in Visual Studio. For those who want it that way. So there... ;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578220" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/VS2012/default.aspx">VS2012</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/MVC4/default.aspx">MVC4</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/javascript/default.aspx">javascript</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/debug/default.aspx">debug</category></item><item><title>How To: Call a generic method with a runtime type</title><link>http://bloggingabout.net/blogs/rick/archive/2012/12/02/how-to-call-a-generic-method-with-a-runtime-type.aspx</link><pubDate>Sun, 02 Dec 2012 10:17:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578193</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>1</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578193</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/12/02/how-to-call-a-generic-method-with-a-runtime-type.aspx#comments</comments><description>&lt;p&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;Developing a generic class that maps datasets, datatables and datarows from a legacy system to my domain model, I ran into an issue. I wanted to call a generic method with a runtime type. Lets say the method looked like this: public string DoSomething&amp;lt;T&amp;gt;(string param). Because I use reflection to iterate properties on a type, the type of the properties was dynamic and only known at runtime. I wanted to do something like this:&lt;/p&gt;
&lt;p&gt;DoSomething&amp;lt;propertyInfo.PropertyType&amp;gt;(&amp;quot;bloggingabout&amp;quot;);&lt;/p&gt;
&lt;p&gt;This however resulted in an error message. The tooltip on the red colored propertyInfo read &amp;quot;Cannot resolve symbol &amp;#39;propertyInfo&amp;#39;&amp;quot;, while the build error stated &amp;quot;The type or namespace name &amp;#39;propertyInfo&amp;#39; could not be found (are you missing a using directive or an assembly reference?)&amp;quot;. This is expected behavior, because &amp;quot;The type argument [...] can be any type recognized by the compiler.&amp;quot; So that says compiler. So the type is parsed (and should be known) at compile time.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;The solution is found in reflection. Taken from the MSDN article for the MethodInfo.MakeGenericMethod Mehod:&lt;br /&gt;&lt;i&gt;The MakeGenericMethod method allows you to write code that assigns specific types to the type parameters of a generic method definition, thus creating a MethodInfo object that represents a particular constructed method. If the ContainsGenericParameters property of this MethodInfo object returns true, you can use it to invoke the method or to create a delegate to invoke the method.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;In our example, this would look something like this:&lt;/p&gt;
&lt;pre style="font-family:Consolas;font-size:12;color:black;background:white;"&gt;instance.GetType()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .GetMethod(&lt;span style="color:#a31515;"&gt;&amp;quot;DoSomething&amp;quot;&lt;/span&gt;)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .MakeGenericMethod(propertyInfo.PropertyType)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Invoke(mapper,&amp;nbsp;&lt;span style="color:blue;"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color:blue;"&gt;object&lt;/span&gt;[]&amp;nbsp;{ &amp;quot;bloggingabout&amp;quot; });&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;More information:&lt;/b&gt;&lt;br /&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/0zk36dx2.aspx"&gt;Generic Type Parameters (C# Programming Guide)&lt;br /&gt;&lt;/a&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.makegenericmethod.aspx"&gt;MethodInfo.MakeGenericMethod Method&lt;/a&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/0zk36dx2.aspx"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578193" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category></item><item><title>Enable preview in Visual Studio 2012 after Update 1</title><link>http://bloggingabout.net/blogs/rick/archive/2012/12/02/enable-preview-in-visual-studio-2012-after-update-1.aspx</link><pubDate>Sun, 02 Dec 2012 09:50:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578207</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>1</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578207</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/12/02/enable-preview-in-visual-studio-2012-after-update-1.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/6864.tabsandwindows_5F00_22FD53EC.png"&gt;&lt;img height="144" width="244" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/6305.tabsandwindows_5F00_thumb_5F00_10485A35.png" align="right" alt="tabsandwindows" border="0" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;margin:0px 0px 0px 20px;display:inline;border-top-width:0px;" title="tabsandwindows" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After installing Visual Studio 2012 Update 1, my Visual Studio stopped opening files in preview mode when I clicked them in the Solution Explorer. This setting seems to have changed with the installation of Update 1. To re-enable opening files clicked (once) in the Solution Explorer in Preview mode, go to &amp;lsquo;Tools&amp;rsquo; &amp;ndash; &amp;lsquo;Options&amp;rsquo; &amp;ndash; &amp;lsquo;Environment&amp;rsquo; &amp;ndash; &amp;lsquo;Tabs and Windows&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;There, check the box under &amp;lsquo;Preview Tab&amp;rsquo; &amp;ndash; &amp;lsquo;Single-click opens files in the preview tab in:&amp;rsquo; &amp;ndash; &amp;lsquo;Solution Explorer (Alt + click to avoid previewing)&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;br /&gt;This is a lot easier: the &amp;#39;Preview Selected Items&amp;#39; button in the Solution Explorer toolbar:
&lt;p&gt;&lt;img src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick/6518.previewbutton.png" alt="Preview Selected Items button" /&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578207" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Tip/default.aspx">Tip</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/VS2012/default.aspx">VS2012</category></item><item><title>How To: Create an ActionLink with a Twitter Bootstrap icon in MVC4</title><link>http://bloggingabout.net/blogs/rick/archive/2012/11/07/how-to-create-an-actionlink-with-a-twitter-bootstrap-icon-in-mvc4.aspx</link><pubDate>Wed, 07 Nov 2012 18:16:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578174</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>2</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578174</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/11/07/how-to-create-an-actionlink-with-a-twitter-bootstrap-icon-in-mvc4.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://twitter.github.com/bootstrap"&gt;Twitter Bootstrap&lt;/a&gt; is a... &amp;quot;Sleek, intuitive, and powerful front-end framework for faster and easier web development.&amp;quot; One of the nice things in Bootstrap is you can use icons from &lt;a href="http://glyphicons.com/"&gt;Glyphicons&lt;/a&gt;. To use these, you can simply use this markup &amp;lt;i class=&amp;quot;icon-fire&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; get a nice fire icon (&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/3324.fire_5F00_57D37DC8.png"&gt;&lt;img title="fire" style="display:inline;border-width:0px;border:0;vertical-align:middle;" alt="fire" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/1261.fire_5F00_thumb_5F00_1E506DD1.png" border="0" height="14" width="14" /&gt;&lt;/a&gt; ).&lt;br /&gt;Translating this into an ActionLink styled as a button in an MVC4 application would look something like the following:&lt;/p&gt;
&lt;pre&gt;&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;@Html.ActionLink(&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;i&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;class&lt;/span&gt;=&lt;span style="color:#0000ff;"&gt;\&lt;/span&gt;&amp;quot;&lt;span style="color:#ff0000;"&gt;icon&lt;/span&gt;-&lt;span style="color:#ff0000;"&gt;fire&lt;/span&gt;\&amp;quot;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; Invent fire&amp;quot;, &amp;quot;fire&amp;quot;, new { @class = &amp;quot;btn&amp;quot; })&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Unfortunately, this renders as follows: 
  &lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/5226.encoded_5F00_50480E5B.png"&gt;&lt;img title="encoded" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" alt="encoded" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/0358.encoded_5F00_thumb_5F00_451E8411.png" border="0" height="27" width="224" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The reason this is not rendered correctly is because Html.ActionLink HtmlEncodes the text you pass in the actionLink parameter. You can check this by opening the System.Web.Mvc assembly in your disassembler of choice, and having a look at the GenerateLinkInternal method on the HtmlHelper class. It HtmlEncodes the linkText, and doesn&amp;#39;t have any option to have it not do that. To solve this, I wrote an extension method called NoEncodeActionLink, looking like this:&lt;/p&gt;
&lt;pre&gt;&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; IHtmlString NoEncodeActionLink(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt; HtmlHelper htmlHelper, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; linkText, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; action, &lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; htmlAttributes) 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;{ 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    TagBuilder builder; 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    UrlHelper urlHelper; 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    urlHelper = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; UrlHelper(htmlHelper.ViewContext.RequestContext); 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    builder = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; TagBuilder(&amp;quot;&lt;span style="color:#8b0000;"&gt;a&lt;/span&gt;&amp;quot;); 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    builder.InnerHtml = linkText; 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    builder.Attributes[&amp;quot;&lt;span style="color:#8b0000;"&gt;href&lt;/span&gt;&amp;quot;] = urlHelper.Action(action); 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    builder.MergeAttributes(&lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; RouteValueDictionary(htmlAttributes)); 
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; MvcHtmlString.Create(builder.ToString());
&lt;/pre&gt;
&lt;pre style="font-size:12px;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;margin:0em;width:100%;background-color:#ffffff;"&gt;}
&lt;/pre&gt;
&lt;/pre&gt;
&lt;p&gt;Calling the new overload (don&amp;#39;t forget to add a using statement to the namespace holding the extension method), the linkText parameter is not HtmlEncoded, which means the ActionLink now renders fine, including the icon (and the button style): 
  &lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/2577.unencoded_5F00_25037754.png"&gt;&lt;img title="unencoded" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" alt="unencoded" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/1447.unencoded_5F00_thumb_5F00_04E86A97.png" border="0" height="44" width="124" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578174" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/MVC4/default.aspx">MVC4</category></item><item><title>Microsoft Touch Mouse, Visual Studio (2012) and scrolling</title><link>http://bloggingabout.net/blogs/rick/archive/2012/10/23/microsoft-touch-mouse-visual-studio-2012-and-scrolling.aspx</link><pubDate>Tue, 23 Oct 2012 08:23:39 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578128</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578128</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/10/23/microsoft-touch-mouse-visual-studio-2012-and-scrolling.aspx#comments</comments><description>&lt;p&gt;My Microsoft Touch Mouse stopped scrolling in Visual Studio on my Windows 8 machine some time ago. Because this kills productivity, I wanted to fix the problem. After trying some things I found that the problem only occurred when I &lt;a href="http://bloggingabout.net/blogs/rick/archive/2012/10/16/howto-have-visual-studio-always-run-as-administrator-on-windows-8.aspx" target="_blank"&gt;ran Visual Studio as Administrator&lt;/a&gt;. Searching a bit further I found this bug to be &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/762365/loss-of-mouse-scrolling-with-microsoft-touch-mouse-with-vs-2012-when-running-as-administrator" target="_blank"&gt;added to Microsoft Connect&lt;/a&gt;. I found a workaround for the problem:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Go to the location where you have Microsoft Mouse and Keyboard Center installed&lt;/li&gt;    &lt;li&gt;Open up the properties of ipoint.exe&lt;/li&gt;    &lt;li&gt;Set it to Run as Administrator&lt;/li&gt;    &lt;li&gt;Kill and restart ipoint.exe (or restart the machine)&lt;/li&gt;    &lt;li&gt;Welcome back scrolling in Visual Studio…!&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Hope this helps&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578128" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Error/default.aspx">Error</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Windows+8/default.aspx">Windows 8</category></item><item><title>HowTo: Have Visual Studio always run as administrator on Windows 8</title><link>http://bloggingabout.net/blogs/rick/archive/2012/10/16/howto-have-visual-studio-always-run-as-administrator-on-windows-8.aspx</link><pubDate>Tue, 16 Oct 2012 11:16:46 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:578117</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>2</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=578117</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/10/16/howto-have-visual-studio-always-run-as-administrator-on-windows-8.aspx#comments</comments><description>&lt;p&gt;In my &lt;a href="http://bloggingabout.net/blogs/rick/archive/2012/10/04/unable-to-access-the-iis-metabase.aspx"&gt;previous post&lt;/a&gt; I wanted my Visual Studio to ‘Run as Administrator’ on my Windows 8 machine. I only managed to get this working for the pinned taskbar icon and not for items in the jumplist or for items you open by double clicking them. The solution to check the box ‘Run as Administrator’ on the compatibility tab of the file properties for devenv.exe was not a solution, because there is no more Compatibility tab in Windows 8 :).    &lt;br /&gt;But there &lt;em&gt;is&lt;/em&gt; a way to have devenv.exe always ‘Run as Administrator’. Here’s how:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Right click devenv.exe en select Troubleshoot compatibility (first picture) &lt;/li&gt;    &lt;li&gt;Select the option ‘Troubleshoot program’ after the wizard has finished detecting issues &lt;/li&gt;    &lt;li&gt;Choose the ‘The program requires additional permissions’ option (second picture). The wizard will apply the ‘Run as Administrator’ setting to devenv.exe &lt;/li&gt;    &lt;li&gt;Click ‘Test the program…’ (third picture - the wizard requires this) and close the wizard &lt;/li&gt;    &lt;li&gt;Enjoy! &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/2867.compat01_5F00_3DF0EB3E.png"&gt;&lt;img title="Picture 1" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="Picture 1" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/8863.compat01_5F00_thumb_5F00_2BA8247C.png" width="199" height="244" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/3513.compat02_5F00_00638D75.png"&gt;&lt;img title="Picture 2" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="Picture 2" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/3750.compat02_5F00_thumb_5F00_2731A3B5.png" width="244" height="189" /&gt;&lt;/a&gt;&amp;#160; &lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/8688.compat03_5F00_72251484.png"&gt;&lt;img title="Picture 3" style="border-left-width:0px;border-right-width:0px;border-bottom-width:0px;display:inline;border-top-width:0px;" border="0" alt="Picture 3" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/1057.compat03_5F00_thumb_5F00_2DE4AD38.png" width="244" height="189" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=578117" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Windows+8/default.aspx">Windows 8</category></item><item><title>Documents.Open returns null, running Word automation under ASP.NET on x64</title><link>http://bloggingabout.net/blogs/rick/archive/2012/02/02/documents-open-returns-null-when-running-under-asp-net-on-an-64-bit-machine.aspx</link><pubDate>Thu, 02 Feb 2012 04:53:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:577121</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>3</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=577121</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2012/02/02/documents-open-returns-null-when-running-under-asp-net-on-an-64-bit-machine.aspx#comments</comments><description>&lt;p&gt;When building an ASPapplication that generates Word documents,&amp;nbsp; it was working fine on&amp;nbsp;the local machine. A&amp;nbsp;windows XP installation with Office 2007.&amp;nbsp;When we&amp;nbsp;deployed it to windows 2008 (64 bit) and Word 2007 we saw that&amp;nbsp;Documents.Open returned null.&amp;nbsp;Other than this, there are no exceptions.&lt;/p&gt;
&lt;p&gt;The code that returned the error (simplified):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new,courier;"&gt;Application app = new Application();&lt;br /&gt;Document doc = app.Documents.Open(ref name);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;As it turns out, a 64 bit system stores temporary files in &amp;quot;C:\Windows\SysWOW64\config\systemprofile\Desktop&amp;quot; folder.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;The solution&lt;/em&gt;&lt;/strong&gt;: create a new directory called &amp;quot;Desktop&amp;quot; inside&amp;nbsp;&amp;quot;C:\Windows\SysWOW64\config\systemprofile\&amp;quot;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=577121" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Error/default.aspx">Error</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/automation/default.aspx">automation</category></item><item><title>HowTo: Save a file from Silverlight using the SaveFileDialog</title><link>http://bloggingabout.net/blogs/rick/archive/2011/01/20/howto-save-a-file-from-silverlight-using-the-savefiledialog.aspx</link><pubDate>Thu, 20 Jan 2011 17:23:57 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:484647</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>3</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=484647</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2011/01/20/howto-save-a-file-from-silverlight-using-the-savefiledialog.aspx#comments</comments><description>&lt;p&gt;Saving a file from Silverlight using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.savefiledialog(v=vs.95).aspx" target="_blank"&gt;SaveFileDialog&lt;/a&gt;, added in Silverlight 3, is easy. If you’re used to desktop development however, you might find yourself getting a SecurityException with the message ‘File operation not permitted. Access to path &amp;#39;xxx&amp;#39; is denied.’. Here’s why:&lt;/p&gt;  &lt;p&gt;In desktop development, you’re used to getting a filename from a SaveFileDialog. Next, you start doing whatever you need to be doing to the file, based on the filename. This would look something like this:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;SaveFileDialog saveFileDialog = &lt;span class="kwrd"&gt;new&lt;/span&gt; SaveFileDialog();

&lt;span class="kwrd"&gt;if&lt;/span&gt; (saveFileDialog.ShowDialog() == &lt;span class="kwrd"&gt;true&lt;/span&gt;)
{
    StreamWriter streamWriter = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(saveFileDialog.SafeFileName);
    streamWriter.Write(&lt;span class="str"&gt;&amp;quot;Follow me on twitter: @rickvdbosch&amp;quot;&lt;/span&gt;);
    streamWriter.Flush();
    streamWriter.Close();
}&lt;/pre&gt;


&lt;p&gt;This results in the SecurityException. First time I saw the property, I genuinely thought it said SaveFileName. But, as you can see, it says SafeFileName. It is named safe, because the returned file name has all file path information removed for security purposes. 
  &lt;br /&gt;

  &lt;br /&gt;In Silverlight, if you want the above functionality, it should look something like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;SaveFileDialog saveFileDialog = &lt;span class="kwrd"&gt;new&lt;/span&gt; SaveFileDialog();

&lt;span class="kwrd"&gt;if&lt;/span&gt; (saveFileDialog.ShowDialog() == &lt;span class="kwrd"&gt;true&lt;/span&gt;)
{
    StreamWriter streamWriter = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(saveFileDialog.OpenFile());
    streamWriter.WriteLine(&lt;span class="str"&gt;&amp;quot;Follow me on twitter: @rickvdbosch&amp;quot;&lt;/span&gt;);
    streamWriter.Flush();
    streamWriter.Close();
}&lt;/pre&gt;

&lt;p&gt;The OpenFile method opens the file specified by the SafeFileName returning a Stream, giving you the opportunity to save whatever you want to save over there.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;&lt;font size="1"&gt;On a side note: the ‘== true’ part in the if condition is needed in this case. Because the ShowDialog method returns a nullable boolean it is not enough to use saveFileDiaolog.ShowDialog() in the condition. Just so you know… :)&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=484647" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Error/default.aspx">Error</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>HowTo: open all files from the Find Results window</title><link>http://bloggingabout.net/blogs/rick/archive/2011/01/17/howto-open-all-files-from-the-find-results-window.aspx</link><pubDate>Mon, 17 Jan 2011 05:49:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:484623</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=484623</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2011/01/17/howto-open-all-files-from-the-find-results-window.aspx#comments</comments><description>&lt;p&gt;Here&amp;rsquo;s a quick Visual Studio tip for you&amp;hellip;&lt;/p&gt;
&lt;p&gt;I frequently search for a specific text in my solution because I need to do something in all places where that text occurs. Today I found out how you can open all the files that are mentioned in the Find Results window.&lt;/p&gt;
&lt;p&gt;Search for the text you&amp;rsquo;re looking for. In my case this is ITest*. &lt;br /&gt;Open up the Search Results window and select all the records where the text was found. You can do this by dragging your mouse cursor over the text or clicking the text of the first search result, holding SHIFT and clicking the text of the last. &lt;br /&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/7382.Search_2D00_Results_2D00_for_2D00_ITest_5F00_605219A0.png"&gt;&lt;img height="90" width="644" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/3581.Search_2D00_Results_2D00_for_2D00_ITest_5F00_thumb_5F00_6B0F70F5.png" alt="Search Results for ITest" border="0" title="Search Results for ITest" style="background-image:none;border-bottom:0px;border-left:0px;margin:5px 5px 5px 0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Right click anywhere &lt;em&gt;&lt;strong&gt;on the selected text&lt;/strong&gt;&lt;/em&gt; and choose &amp;lsquo;Go to location&amp;rsquo;. If you click anywhere other than on selected text, you will lose the selection and you&amp;rsquo;ll probably get just one file opened. When all files are opened you will keep the &amp;lsquo;Go To Next Location F8&amp;rsquo; and &amp;lsquo;Go To Previous Location SHIFT + F8&amp;rsquo; functionality. That might be a nice one to loop through all the locations where your text was found. Especially when it was found more than once in one file.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:xx-small;"&gt;* The usefulness of searching for this interface is arbitrary due to functionality as &amp;lsquo;Find all references&amp;rsquo; and so on. Luckily I&amp;rsquo;m only using it for this example. So lets not focus on that but on the tip this post is about ;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=484623" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Tip/default.aspx">Tip</category></item><item><title>HowTo: have Visual Studio open XAML documents in code view</title><link>http://bloggingabout.net/blogs/rick/archive/2011/01/04/howto-have-visual-studio-open-xaml-documents-in-code-view.aspx</link><pubDate>Tue, 04 Jan 2011 09:25:18 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:484531</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=484531</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2011/01/04/howto-have-visual-studio-open-xaml-documents-in-code-view.aspx#comments</comments><description>&lt;p&gt;Just a small post to start the new year... and let it be a good one!&lt;/p&gt;  &lt;p&gt;When opening a XAML document in Visual Studio, it opens in split view by default. This might become annoying when you have a large XAML document, because all the content needs to be rendered before you can get some work done.&lt;/p&gt;  &lt;p&gt;Here’s how you can have Visual Studio open XAML documents in code view:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Go to &lt;em&gt;Tools&lt;/em&gt;, &lt;em&gt;Options&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Under &lt;em&gt;Text Editor &lt;/em&gt;open the&lt;em&gt; XAML&lt;/em&gt; section and select &lt;em&gt;Miscellaneous&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Under &lt;em&gt;Default View&lt;/em&gt; check the &lt;em&gt;Always open documents in full XAML view&lt;/em&gt; box (see image below) &lt;/li&gt;    &lt;li&gt;Click &lt;em&gt;OK&lt;/em&gt; to apply and you’re all done! &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/4544.fullxamlview_5F00_21CB17B8.png"&gt;&lt;img style="background-image:none;border-right-width:0px;margin:5px auto;padding-left:0px;padding-right:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="fullxamlview" border="0" alt="fullxamlview" src="http://bloggingabout.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/rick.metablogapi/4403.fullxamlview_5F00_thumb_5F00_0C012F5B.png" width="400" height="309" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=484531" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/VS2010/default.aspx">VS2010</category></item><item><title>Visual Studio: Zero-impact Projects &amp; Cutting/copying empty lines</title><link>http://bloggingabout.net/blogs/rick/archive/2010/05/19/Visual-Studio_3A00_-Zero_2D00_impact-Projects-_2600_-Cutting_2F00_copying-empty-lines.aspx</link><pubDate>Wed, 19 May 2010 16:07:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:483290</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=483290</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2010/05/19/Visual-Studio_3A00_-Zero_2D00_impact-Projects-_2600_-Cutting_2F00_copying-empty-lines.aspx#comments</comments><description>&lt;p&gt;Yesterday I remembered&amp;nbsp;two&amp;nbsp;Visual Studio&amp;nbsp;options &lt;a href="http://blogs.msdn.com/saraford/"&gt;Sara Ford&lt;/a&gt; told about in a presentation of her I attended a while back.&amp;nbsp;Changing&amp;nbsp;them&amp;nbsp;made me happy... :)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Zero-impact projects&lt;/strong&gt;&lt;br /&gt;When I have to test something real quick, I tend to create a new project in Visual Studio and scribble some code to test whatever I want to test at that point. This causes my project directory to be&amp;nbsp;filled with projects&amp;nbsp;named &amp;#39;WindowsFormsApplication14&amp;#39; or something like that. To make this stop, go to Tools - Options - Projects and Solutions - General. Uncheck the option &amp;#39;Save new projects when created&amp;#39;. This way those newly made (and shortly used) projects aren&amp;#39;t saved untill you explicitly tell Visual Studio to do so. No more &amp;#39;WindowsFormsApplication63&amp;#39; for you! Unless you want to name it that way intentionally, of course...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cutting/copying empty lines&lt;/strong&gt;&lt;br /&gt;We probably all experienced this at one time or another: you select some code, copy it, go to an empty line where you want to past the code.......and you press CTRL + C by accident. With the default settings, you just copied an empty line and have lost the stuff you copied earlier. But with this next option, empty lines won&amp;#39;t get copied or cut anymore! Go to Tools - Options - Text Editor - All languages (or just the language you want to change this setting for) and deselect the option &amp;#39;Apply Cut or Copy commands to blank lines when there is no selection&amp;#39;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=483290" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Development/default.aspx">Development</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/dotnetmag/default.aspx">dotnetmag</category></item><item><title>Running Windows Vista on a MacBook Pro</title><link>http://bloggingabout.net/blogs/rick/archive/2009/07/10/running-windows-vista-on-a-macbook-pro.aspx</link><pubDate>Fri, 10 Jul 2009 13:45:22 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481922</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>1</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=481922</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2009/07/10/running-windows-vista-on-a-macbook-pro.aspx#comments</comments><description>&lt;p&gt;When installing Windows Vista on a MacBook Pro, the default driver for the Wireless Network Adapter doesn’t function properly. To get the Wireless Network Adapter to work, first install the Boot Camp Services by inserting your OS X DVD and running the setup. Next you need to install the Boot Camp 2.1 update. You can download that one by running Apple Software Update, which is installed as part of the Boot Camp Services. And that’s where things go wrong… The Boot Camp update installation downloads properly, but doesn’t complete.&lt;/p&gt;  &lt;p&gt;The reason the update doesn’t install properly? The Boot Camp 2.1 update is American only and therefore expects to find a key in the registry with the decimal value 1033 (American English). Since the Windows version we installed was Dutch, the update couldn’t complete.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;How to fix this issue&lt;/strong&gt;    &lt;br /&gt;To fix this problem, follow the steps below:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Open the registry editor&lt;/li&gt;    &lt;li&gt;Search for the ProductName key with the value ‘Boot Camp Services’ (for the Dutch version, this was ‘Boot Camp-Services’), located under HKEY_CLASSES_ROOT\Installer and then some…&lt;/li&gt;    &lt;li&gt;Double click the Language key in that same location to open it&lt;/li&gt;    &lt;li&gt;Change the value to 409 (Hex) or 1033 (Decimal)&lt;/li&gt;    &lt;li&gt;Reboot the machine and install the Boot Camp update&lt;/li&gt;    &lt;li&gt;That’s it!&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=481922" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category></item><item><title>HowTo: Add a body onload script to a page that uses a MasterPage</title><link>http://bloggingabout.net/blogs/rick/archive/2009/01/30/howto-add-a-body-onload-script-to-a-page-that-uses-a-masterpage.aspx</link><pubDate>Fri, 30 Jan 2009 05:57:00 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:481081</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>1</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=481081</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2009/01/30/howto-add-a-body-onload-script-to-a-page-that-uses-a-masterpage.aspx#comments</comments><description>&lt;p&gt;When you use a MasterPage to define the design of your website, you might come across the problem that there is no body element in a web content form. This can be a problem when you want to add an onload script to a specific page. You could of course add the onload on the MasterPage, but you might not want the script to run on every page. There are several workarounds to fix this &amp;lsquo;problem&amp;rsquo;. The one I used last week was to do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the runat=&amp;rdquo;server&amp;rdquo; tag on the body in the MasterPage &lt;/li&gt;
&lt;li&gt;Add a unique ID on the body in the MasterPage &lt;/li&gt;
&lt;li&gt;Add a method to the MasterPage to set the onload for the body. This might look a bit like this (of course you can also have the script for the load be a parameter for the method):
&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;
&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;
&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SetBodyLoad()&lt;/pre&gt;
&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     MasterPageBody.Attributes.Add(&lt;span style="color:#006080;"&gt;&amp;quot;onLoad&amp;quot;&lt;/span&gt;, &lt;span style="color:#006080;"&gt;&amp;quot;initialize()&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Add this line of code in the Page_Load of the page you want to have the onload:
&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;
&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;
&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; ((MasterPageName)Master).SetBodyLoad();&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This worked for me! Hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=481081" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category></item><item><title>The absolute minimum every software developer ...</title><link>http://bloggingabout.net/blogs/rick/archive/2008/06/11/the-absolute-minimum-every-software-developer.aspx</link><pubDate>Wed, 11 Jun 2008 04:54:42 GMT</pubDate><guid isPermaLink="false">813b6dfd-644e-4573-a816-eebab56ba0d0:460094</guid><dc:creator>Rick van den Bosch</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://bloggingabout.net/blogs/rick/commentapi.aspx?PostID=460094</wfw:comment><comments>http://bloggingabout.net/blogs/rick/archive/2008/06/11/the-absolute-minimum-every-software-developer.aspx#comments</comments><description>&lt;p&gt;One of the posts that is being read quite frequently over here is &lt;a href="http://bloggingabout.net/blogs/rick/archive/2005/05/18/4118.aspx" target="_blank"&gt;HOWTO: Encode a password using MD5 in C# (or: howto calculate the MD5 hash for a string)&lt;/a&gt;. One of the (many) reactions to that post was from one Simucal, stating:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Also, to the original poster, Rick van den Bosch... shame on you for using ASCIIEncoding.Default.GetBytes().&amp;nbsp; You do realize that would seriously restrict the usefulness of your method to working only in languages that ASCII has the character sets for, right?&lt;/p&gt; &lt;p&gt;I suggest you read this article entitled:  &lt;p&gt;&lt;a href="http://www.joelonsoftware.com/articles/Unicode.html" target="_blank"&gt;The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Yes, I do realize that using ASCIIEncoding.Default.GetBytes() would seriously restrict the usefulness of the method to working only in languages that ASCII has the character sets for. The primary reason for the post was to illustrate the way to calculate the hash. Representing it as a string was only there to be complete for a specific scenario. I did not try to write a hashing function for every language ;)&lt;br /&gt;&lt;br /&gt;That being said, the post Simucal refers to &lt;em&gt;is&lt;/em&gt; a good one, and it truly is &lt;em&gt;the absolute minimum every software developer absolutely, positively must know about unicode and character sets&lt;/em&gt;. And I guess there are no excuses ;). So if you haven&amp;#39;t done so already, go and &lt;a href="http://www.joelonsoftware.com/articles/Unicode.html" target="_blank"&gt;read it&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://bloggingabout.net/aggbug.aspx?PostID=460094" width="1" height="1"&gt;</description><category domain="http://bloggingabout.net/blogs/rick/archive/tags/.Net/default.aspx">.Net</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/HowTo/default.aspx">HowTo</category><category domain="http://bloggingabout.net/blogs/rick/archive/tags/Blog/default.aspx">Blog</category></item></channel></rss>