<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/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>SuperSKa Weblog</title><link>http://msmvps.com/blogs/superska/default.aspx</link><description>Stefan Kamphuis on DotNetNuke, asp.net, Microsoft and whatever he finds blogworthy.</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Reflection without locking</title><link>http://msmvps.com/blogs/superska/archive/2009/11/01/reflection-without-locking.aspx</link><pubDate>Sun, 01 Nov 2009 18:07:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1736829</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1736829</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/11/01/reflection-without-locking.aspx#comments</comments><description>&lt;p&gt;Every now and then, you need to use reflection. And usually - at least for me that is - you need to change the assembly you are reflecting. So, this is what happens:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;you&amp;#39;re running application A; &lt;/li&gt;    &lt;li&gt;have it load your assembly; &lt;/li&gt;    &lt;li&gt;test what you need to test and find something needs to change in the assembly; &lt;/li&gt;    &lt;li&gt;make the change, and build it; &lt;/li&gt;    &lt;li&gt;build FAILS. ouch. Wazzup? &lt;/li&gt;    &lt;li&gt;The DLL is still locked by Application A so can&amp;#39;t be overwritten; &lt;/li&gt;    &lt;li&gt;Stop Application A; &lt;/li&gt;    &lt;li&gt;Build assembly again; &lt;/li&gt;    &lt;li&gt;Start application A; &lt;/li&gt;    &lt;li&gt;Get to the point where you left it and reload the assembly.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Dang, that&amp;#39;s awful. Even more afwful, is the fact that there’s no way to unload an assembly from a running AppDomain. Luckily, there&amp;#39;s a way to prevent the assem,bly from being locked in the first place. That way you’ll be able to rebuild the assembly after all. In stead of loading the assembly using &lt;font size="2" face="Courier New"&gt;Assembly.LoadFile();&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;You can read the .dll file itself into a bytearray and load the assembly from that. This way, the file itself will not be locked and can be rebuild over and over again:   &lt;br /&gt;&lt;font face="Courier New"&gt;FileStream fs = File.OpenRead(fileName);     &lt;br /&gt;Byte[] bytes=new byte[fs.Length];      &lt;br /&gt;fs.Read(bytes, 0,(int)fs.Length);      &lt;br /&gt;fs.Close();      &lt;br /&gt;interfaceAssembly = Assembly.Load(bytes);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Off course, if you want the application to actually use the newly built assembly, you’ll need to have it reload the assembly again…&lt;/p&gt;  &lt;p&gt;Fun Stuff.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1736829" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/.NET+Reflection/default.aspx">.NET Reflection</category></item><item><title>Add Bing to FireFox</title><link>http://msmvps.com/blogs/superska/archive/2009/06/01/add-bing-to-firefox.aspx</link><pubDate>Mon, 01 Jun 2009 10:07:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693518</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1693518</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/06/01/add-bing-to-firefox.aspx#comments</comments><description>&lt;p&gt;As most people know by now: Microsft has launched it’s new search provider &lt;a href="http://www.bing.com/" target="_blank"&gt;bing&lt;/a&gt;. I thought I’d give it a try, but when I clicked the link “Add bing to your browser”,FireFox told me it wasn’t supported.&lt;/p&gt;  &lt;p&gt;Luckily it’s not that hard to add it anyway, due to the OpenSearchDescription specification.&lt;/p&gt;  &lt;p&gt;Just download this file:&lt;/p&gt;  &lt;p&gt;&lt;script type="text/javascript"&gt;
/* Copyright (C) 2009 Microsoft Corporation */var _d=document,_dh=_d.getElementsByTagName(&amp;quot;head&amp;quot;)[0];function $newScript(c,d,b){var a=_d.createElement(&amp;quot;script&amp;quot;);a.id=d||&amp;quot;&amp;quot;;a.src=c;if(!b)_dh.appendChild(a);return a}

&lt;/script&gt;&lt;script type="text/javascript"&gt;                  
	if(null==window[&amp;quot;$Config&amp;quot;])
		window[&amp;quot;$Config&amp;quot;] = {};
	$Config.headerRenderTime = (new Date()).getTime();
	if (typeof(SymRealWinOpen)!=&amp;quot;undefined&amp;quot;){window.open = SymRealWinOpen;}

	window.$Config.Themes = {
		baseUrl:&amp;quot;http://css.wlxrs.com/MWq06zJRk8R497sW6bhNCCM1HKhdp!8xhtnqlulaqTCXfR3v-bMAyyFk8srxitiKaTDtNX2C!y4rTKxA3l2pLQ/&amp;quot;,current:&amp;quot;X_4_Prairie&amp;quot;,version:&amp;quot;15.0.2020&amp;quot;,url:&amp;quot;http://css.wlxrs.com/MWq06zJRk8R497sW6bhNCCM1HKhdp!8xhtnqlulaqTCXfR3v-bMAyyFk8srxitiKaTDtNX2C!y4rTKxA3l2pLQ/X_4_Prairie/15.0.2020/&amp;quot;};if(!document.namespaces[&amp;quot;web&amp;quot;])try{{document.namespaces.add(&amp;quot;web&amp;quot;,&amp;quot;http://www.live.com/schemas&amp;quot;);}}catch(e){{}}&lt;/script&gt;&lt;script type="text/javascript" src="http://msc.wlxrs.com/lQNgXBQYoayUK1wMOhAgVw/scripts/LiveFolders.js"&gt;&lt;/script&gt;&lt;script type="text/javascript" src="http://msc.wlxrs.com/lQNgXBQYoayUK1wMOhAgVw/scripts/Self.js"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;
      function doDelete() { if (confirm(&amp;#39;Je staat op het punt bing.xml definitief te verwijderen van Windows Live SkyDrive. De personen met wie je bing.xml deelt, hebben dan geen toegang meer.&amp;#39;)) { trySubmit(&amp;quot;deleteItem&amp;quot;); } }
    &lt;/script&gt;&lt;script type="text/javascript"&gt;/* Copyright (C) 2009 Microsoft Corporation */function $c_TreatTile(a,e){a.style.display=e;var d=a.width,c=a.height,b=19;if(d&amp;gt;=c||c&lt;/script&gt;&lt;iframe style="border-bottom:#dde5e9 1px solid;border-left:#dde5e9 1px solid;padding-bottom:0px;background-color:#ffffff;margin:3px;padding-left:0px;width:240px;padding-right:0px;height:66px;border-top:#dde5e9 1px solid;border-right:#dde5e9 1px solid;padding-top:0px;" src="http://cid-7459ada2048d9e82.skydrive.live.com/embedrowdetail.aspx/Public/bing.xml" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;And put in your FireFox/searchplugins folder (Program Files\Mozilla FireFox\searchplugins by default on Windows). And voilá, bing is now added to your searchbox:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_54076EE0.png" width="354" height="34" /&gt; &lt;/p&gt;  &lt;p&gt;Oh, and thanks to Mobobit Software for there &lt;a href="http://www.motobit.com/util/base64-decoder-encoder.asp" target="_blank"&gt;online base64 encoder&lt;/a&gt;, I used it for the icon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1693518" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/FireFox/default.aspx">FireFox</category><category domain="http://msmvps.com/blogs/superska/archive/tags/Bing/default.aspx">Bing</category></item><item><title>Using FCK Editor with ASP.NET MVC</title><link>http://msmvps.com/blogs/superska/archive/2009/04/06/using-fck-editor-with-asp-net-mvc.aspx</link><pubDate>Mon, 06 Apr 2009 11:22:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1685065</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1685065</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/04/06/using-fck-editor-with-asp-net-mvc.aspx#comments</comments><description>&lt;p&gt;First of, what is this &lt;a title="FCK Editor" href="http://www.fckeditor.net/" target="_blank"&gt;FCKEditor&lt;/a&gt;? Well, it&amp;#39;s an HTML Text Editor. It&amp;#39;s free and open source, cross browser, extensible and there are probably quite a few more buzzwords applicable. Oh... and it&amp;#39;s also the default HTML Text Editor provided with &lt;a title="DotNetNuke" href="http://www.dotnetnuke.com/" target="_blank"&gt;DotNetNuke&lt;/a&gt;. Fck Editor is soon to be replaced by &lt;a title="CK Editor" href="http://ckeditor.com" target="_blank"&gt;CK Editor&lt;/a&gt; but I&amp;#39;ll stick with Fck for now. CK will work mostly the same though.&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_thumb.png" align="right" border="0" width="244" height="213" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;First, you&amp;#39;ll need to &lt;a title="download Fck Editor" href="http://www.fckeditor.net/download" target="_blank"&gt;download Fck Editor&lt;/a&gt;. Unzip the downloaded file to see what&amp;#39;s in there.&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll need to copy the &amp;quot;editor&amp;quot; folder over to you Contents folder in you ASP.NET MVC website. I chose the path &amp;quot;/Content/Js/ Fck&amp;quot; to paste it in.&lt;/p&gt;
&lt;p&gt;Two other files you might want to copy over to this same folder are in the root of the downoaded zipfile: &lt;i&gt;fckeditor.js&lt;/i&gt; and &lt;i&gt;fckconfig.js&lt;/i&gt;. The latter is expected by the editor and (suprisingly) contains configuration settings for the editor, while the first contains a few nice javascript functions to instanciate the editor.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_thumb_5F00_1.png" border="0" width="244" height="198" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Next, include the fckeditor.js file in your page:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;lt;%= Url.Content(&amp;quot;&lt;/span&gt;~/&lt;span class="attr"&gt;Content&lt;/span&gt;/&lt;span class="attr"&gt;Js&lt;/span&gt;/&lt;span class="attr"&gt;fck&lt;/span&gt;/&lt;span class="attr"&gt;fckeditor&lt;/span&gt;.&lt;span class="attr"&gt;js&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;quot;) %&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;All set. Now you&amp;#39;ll need to add a textarea to your page:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;= Html.TextArea(&lt;span class="str"&gt;&amp;quot;FckEditor1&amp;quot;&lt;/span&gt;, &amp;quot;Some Value&amp;quot;, &lt;br /&gt;  &lt;span class="kwrd"&gt;new&lt;/span&gt; { @name=&lt;span class="str"&gt;&amp;quot;FckEditor1&amp;quot;&lt;/span&gt; })&lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Important thing here, is the name property of the TextArea being set to the same value as the Id of it.&lt;/p&gt;
&lt;p&gt;To finish the client side of things off, you&amp;#39;l need to add some javascript to turn the textarea into a FckEditor at runtime. This can be copied from the samples of course, except for the Url.Contents part:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;window.onload = &lt;span class="kwrd"&gt;function&lt;/span&gt;()&lt;br /&gt;{&lt;br /&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; sBasePath = &lt;span class="str"&gt;&amp;#39;&amp;lt;%= Url.Content(&amp;quot;~/Content/Js/Fck/&amp;quot;) %&amp;gt;&amp;#39;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;var&lt;/span&gt; oFCKeditor = &lt;span class="kwrd"&gt;new&lt;/span&gt; FCKeditor( &lt;span class="str"&gt;&amp;#39;FckEditor1&amp;#39;&lt;/span&gt; ) ;&lt;br /&gt;  oFCKeditor.BasePath = sBasePath ;&lt;br /&gt;  oFCKeditor.ReplaceTextarea() ;&lt;br /&gt;}&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now, to prevent the server error &amp;quot;&lt;b&gt;A potentially dangerous Request.Form value was detected from the client &lt;/b&gt;&amp;quot;, you should add the attribute &amp;quot;ValidateInput&amp;quot; to your controller&amp;#39;s action method like this&amp;quot;:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;[ValidateInput(&lt;span class="kwrd"&gt;false&lt;/span&gt;)]&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Save(&lt;span class="kwrd"&gt;int&lt;/span&gt; id)&lt;br /&gt;{&lt;br /&gt;    ...&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;With this, you&amp;#39;re all set. The contents of the TextArea field you started out with, will contain the contents of the FckEditor control.&lt;/p&gt;
&lt;p&gt;Have fun! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1685065" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://msmvps.com/blogs/superska/archive/tags/FckEditor/default.aspx">FckEditor</category></item><item><title>MVP Award 2009 !!!</title><link>http://msmvps.com/blogs/superska/archive/2009/04/02/mvp-award-2009.aspx</link><pubDate>Thu, 02 Apr 2009 08:42:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1684071</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1684071</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/04/02/mvp-award-2009.aspx#comments</comments><description>&lt;p&gt;Yes! I received the email I was hoping for. April 1st is still a bit odd to receive the mail, but after a few checks to see if it&amp;#39;s real I realized I really have received the MVP Award for the 2nd time now.&lt;/p&gt;  &lt;p&gt;Man, I&amp;#39;m happy &lt;img alt="Party" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/74_74.gif" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1684071" width="1" height="1"&gt;</description></item><item><title>ASP.NET MVC: MultiSelectListBox without selection</title><link>http://msmvps.com/blogs/superska/archive/2009/03/16/asp-net-mvc-multiselectlistbox-without-selection.aspx</link><pubDate>Mon, 16 Mar 2009 07:31:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1678362</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1678362</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/16/asp-net-mvc-multiselectlistbox-without-selection.aspx#comments</comments><description>&lt;p&gt;Alright, now that was one hell of a mystery. For some odd reason my MultiSelectListBox didn&amp;#39;t show the selected items like it should.&lt;/p&gt;
&lt;p&gt;The case was very simple, and easily reproducible too. Start of in VS2008 with a new MVC Web Application, open up the HomeController class and change it&amp;#39;s code to this (only italic code was added):&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HomeController : Controller&lt;br /&gt;    {&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult Index()&lt;br /&gt;        {&lt;br /&gt;            ViewData[&lt;span class="str"&gt;&amp;quot;Message&amp;quot;&lt;/span&gt;] = &lt;span class="str"&gt;&amp;quot;Welcome to ASP.NET MVC!&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;            var dic = &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;, &lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;();&lt;br /&gt;            dic.Add(&lt;span class="str"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;First thing&amp;quot;&lt;/span&gt;);&lt;br /&gt;            dic.Add(&lt;span class="str"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Second thing&amp;quot;&lt;/span&gt;);&lt;br /&gt;            dic.Add(&lt;span class="str"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Third thing&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            var sel = &lt;span class="kwrd"&gt;new&lt;/span&gt; ArrayList();&lt;br /&gt;            sel.Add(&lt;span class="str"&gt;&amp;quot;2&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            ViewData[&lt;span class="str"&gt;&amp;quot;multiselect&amp;quot;&lt;/span&gt;] = &lt;span class="kwrd"&gt;new&lt;/span&gt; MultiSelectList( dic, &lt;span class="str"&gt;&amp;quot;Key&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Value&amp;quot;&lt;/span&gt;, sel);&lt;br /&gt;&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; View();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult About()&lt;br /&gt;        {&lt;br /&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; View();&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;
&lt;p&gt;As you can see, this adds a MultiSelectList to the ViewData object. It conatins a dictionary with 3 items. In addition an ArrayList with 1 string is passed, to represent the selected items. Now, open up Home\Index.aspx and add the following code somewhere in the HTML-Body:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;%= Html.ListBox(&lt;span class="str"&gt;&amp;quot;multiselect&amp;quot;&lt;/span&gt;, ViewData[&lt;span class="str"&gt;&amp;quot;multiselect&amp;quot;&lt;/span&gt;] &lt;span class="kwrd"&gt;as&lt;/span&gt; MultiSelectList)%&amp;gt;&lt;/pre&gt;
&lt;p&gt;When running the application I expect the homepage to show up with the second item in the select list selected, but in stead it showsno selection at all:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width:0px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_3.png" border="0" height="361" width="471" /&gt; &lt;/p&gt;
&lt;p&gt;It took quite some puzzling, but it the problem turned out to be caused by the element in ViewData having the same name as the Id for the control. If you change the line in Home\Index.aspx as follows:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;%= Html.ListBox(&lt;span class="str"&gt;&amp;quot;someMultiselect&amp;quot;&lt;/span&gt;, ViewData[&lt;span class="str"&gt;&amp;quot;multiselect&amp;quot;&lt;/span&gt;] &lt;span class="kwrd"&gt;as&lt;/span&gt; MultiSelectList)%&amp;gt;&lt;/pre&gt;
&lt;p&gt;The selection will finally show:&lt;/p&gt;
&lt;p&gt;&lt;img style="border-right-width:0px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_6.png" border="0" height="359" width="466" /&gt; &lt;/p&gt;
&lt;p&gt;Pfff, glad I nailed that one...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1678362" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>LINQ to SQL Connectionstring in web.config</title><link>http://msmvps.com/blogs/superska/archive/2009/03/13/linq-to-sql-connectionstring-in-web-config.aspx</link><pubDate>Fri, 13 Mar 2009 04:38:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1677869</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1677869</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/13/linq-to-sql-connectionstring-in-web-config.aspx#comments</comments><description>&lt;p&gt;For starters, there&amp;#39;s probably dozens of places on the web already, with a solution for this very same issue, but here&amp;#39;s mine anyway.&lt;/p&gt;  &lt;p&gt;The issue is this: when creating a website in ASP.NET using LINQ to SQL, you&amp;#39;ve probably guessed it would be a good idea to put the connectionstring in web.config. Especially since there&amp;#39;s a special section for them there.&lt;/p&gt;  &lt;p&gt;However, when you create a LINQ to SQL Databaclasses (.dbml) file and drag your tables on it, it&amp;#39;s automatically configured to use the database you dragged the tables from.&lt;/p&gt;  &lt;p&gt;And it&amp;#39;s pretty easy to solve too. First, we want to get the connectionstring out of the .dbml file. To do this, open the .dbml file in the designer and change it&amp;#39;s data-properties to match this:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_3.png" width="419" height="125" /&gt; &lt;/p&gt;  &lt;p&gt;Then, create a new partial class for the generated DataContext class with only a default constructor in it. This default constructor will pass the connectionstring from web.config to the constructor if it&amp;#39;s base class, and you&amp;#39;re al set:&lt;/p&gt;  &lt;pre style="border-bottom:#cecece 1px solid;border-left:#cecece 1px solid;padding-bottom:5px;background-color:#fbfbfb;min-height:40px;padding-left:5px;width:450px;padding-right:5px;overflow:auto;border-top:#cecece 1px solid;border-right:#cecece 1px solid;padding-top:5px;"&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; partial &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; MyDataContext{
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;    &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MyDataContext()
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;        : &lt;span style="color:#0000ff;"&gt;base&lt;/span&gt;(ConfigurationManager.ConnectionStrings[&amp;quot;&lt;span style="color:#8b0000;"&gt;MyConnectionString&lt;/span&gt;&amp;quot;].ConnectionString,mappingSource)
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color:#fbfbfb;margin:0em;width:100%;font-family:consolas,&amp;#39;Courier New&amp;#39;,courier,monospace;font-size:10px;"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This way, you can always regenerate your dataclasses without having to remember to change &lt;/p&gt;

&lt;p&gt;use the right connectstring.&lt;/p&gt;

&lt;p&gt;Have Fun!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1677869" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://msmvps.com/blogs/superska/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>ASP.NET: Leaping from Webforms to MVC - part 2</title><link>http://msmvps.com/blogs/superska/archive/2009/03/09/asp-net-leaping-from-webforms-to-mvc-part-2.aspx</link><pubDate>Mon, 09 Mar 2009 08:56:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1676866</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1676866</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/09/asp-net-leaping-from-webforms-to-mvc-part-2.aspx#comments</comments><description>&lt;p&gt;Alright, some time has passed since my &lt;a href="http://msmvps.com/blogs/superska/archive/2009/03/02/asp-net-leaping-from-webforms-to-mvc.aspx"&gt;previous post on this matter&lt;/a&gt;. And I must say, I&amp;#39;m not getting more enthusiastic on ASP.NET MVC. Not that it&amp;#39;s not good or anything, it just solves some problems I wasn&amp;#39;t experiencing (more on that &lt;a href="http://www.asp.net/learn/mvc/tutorial-01-cs.aspx"&gt;here&lt;/a&gt;). The main issue I&amp;#39;m running into is that my pages are somewhat dynamic. That means, based on several conditions, the form displays in one of several ways (for example: based on a property of an object a field displays as either a label or a textbox).&lt;/p&gt; &lt;p&gt;At this point I&amp;#39;m typing a whole lot of crappy code in my HTML within &amp;lt;% %&amp;gt; tags. It just feels soooo retro...&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" border="0" alt="retro code" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_thumb.png" width="644" height="199" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1676866" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>Unable to save changes to a table (SQL2008)</title><link>http://msmvps.com/blogs/superska/archive/2009/03/03/unable-to-save-changes-to-a-table-sql2008.aspx</link><pubDate>Tue, 03 Mar 2009 10:50:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1675348</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1675348</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/03/unable-to-save-changes-to-a-table-sql2008.aspx#comments</comments><description>&lt;p&gt;Don&amp;#39;t you love it when you have just a tiny task and get surprised by something you never heard of? I don&amp;#39;t but still it happens...&lt;/p&gt; &lt;p&gt;So, I need to add a column to a table in my local SQL2008 database. Open up SQL Server Management Studio, navigate to the table, right click, choose Design Table, add the column and click the diskette icon (how long will that still be around?). Easy as that, except that I get punched in the face by this message:&lt;/p&gt; &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" border="0" alt="Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can&amp;#39;t be re-created or enabled the option Prevent saving changes that require the table to be re-created." src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_3.png" width="501" height="77" /&gt; &lt;/p&gt; &lt;p&gt;Never heard of that. I&amp;#39;m pretty sure the table can be dropped and re-created, so I&amp;#39;ll start off searching for the option &amp;quot;Prevent saving changes that require the table to be re-created&amp;quot;.&lt;/p&gt; &lt;p&gt;But I DO love it when you find an option you&amp;#39;re looking for at first try. Tools, Options, Designers, Table and Database designers:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_5.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;border-top:0px;border-right:0px;" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_thumb_5F00_1.png" width="644" height="374" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1675348" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://msmvps.com/blogs/superska/archive/tags/SQL+Server+Management+Studio+2008/default.aspx">SQL Server Management Studio 2008</category><category domain="http://msmvps.com/blogs/superska/archive/tags/SQL+Server/default.aspx">SQL Server</category></item><item><title>ASP.NET: Leaping from Webforms to MVC</title><link>http://msmvps.com/blogs/superska/archive/2009/03/02/asp-net-leaping-from-webforms-to-mvc.aspx</link><pubDate>Mon, 02 Mar 2009 15:06:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1675230</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1675230</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/02/asp-net-leaping-from-webforms-to-mvc.aspx#comments</comments><description>&lt;p&gt;Ever since late 2007 (I think &lt;img alt="Thinking" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/72_72.gif" /&gt;) I&amp;#39;ve been reading quite a bit on the ASP.NET MVC framework. Even did some playing around here and there but never got to use it on a project. Until last week that is. I&amp;#39;m now working on a website that&amp;#39;s built entirely on the ASP.NET MVC framework. And of course, working on a project things are just a tad different from playing around a bit.&lt;/p&gt; &lt;p&gt;So, what is it that makes working with the MVC Framework so much different from Webforms? Well, let&amp;#39;s just put a small list here of some of the things I ran into. Needless to say that this is not a complete list, nor is it intended to be...&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Where are the servercontrols?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Well, errrr, they&amp;#39;re gone. You don&amp;#39;t have them. You&amp;#39;re writing good old HTML again yourself. Of course, the advantage here is that you gain a lot of control over the HTML of your website. But, of course, no Servercontrols means &amp;quot;no events&amp;quot;. You even need to pull a trick to make a DropDownList autopostback (more on that &lt;a href="http://msmvps.com/blogs/superska/archive/2009/03/02/autopostback-dropdownlist-with-asp-net-mvc.aspx"&gt;here&lt;/a&gt;)...&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Only one &amp;lt;Form&amp;gt; in a page?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Alright, an advantage of the MVC Framework. Every now and then I tend to run into this situation where I need some part of a page to submit to a different URL. In ASP.NET you need to use javascript &lt;img alt="Nerd" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/49_49.gif" /&gt; to change the Action of the Form before it&amp;#39;s submitted. Or at least, that&amp;#39;s one approach of numerous you could choose from...&lt;/p&gt; &lt;p&gt;In ASP.NET MVC you can easily have different forms on a single page. Love that part&lt;img alt="Red Lips" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/kiss.gif" /&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;More to come&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;... as I experience. I decided to post and update this one along the way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1675230" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>Autopostback DropDownList with ASP.NET MVC</title><link>http://msmvps.com/blogs/superska/archive/2009/03/02/autopostback-dropdownlist-with-asp-net-mvc.aspx</link><pubDate>Mon, 02 Mar 2009 01:44:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1675241</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1675241</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2009/03/02/autopostback-dropdownlist-with-asp-net-mvc.aspx#comments</comments><description>&lt;p&gt;&lt;img style="border-right-width:0px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" alt="PropertiesPane" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska/image_5F00_3.png" align="right" border="0" height="219" width="318" /&gt;Didn&amp;#39;t you love the days back when you could just open up the properties tab for your DropDownList in ASP.NET and set the AutoPostBack Property to True? You could even write code in your codebehind class to handle the event properly. Cool, right? &lt;img alt="Hot" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/shades_smile.gif" /&gt;&lt;/p&gt;
&lt;p&gt;But these are the days of the ASP.NET MVC framework, so everything&amp;#39;s different now. Well, of course I&amp;#39;m being a bit sarcastic &lt;img alt="Sarcastic" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/50_50.gif" /&gt; here and there are a lot of advantages too to the MVC Framework, but still it requires more work to achieve things-that-used-to-be-simple.&lt;/p&gt;
&lt;p&gt;Anyway, back to the AutoPostBack of the DropDownList. First, of course, you need to have a DropDownList on your page:&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;dropDown&amp;#39;&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;dropDown&amp;#39;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;selected&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;selected&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Option 1&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Option 2&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;option&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;select&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span class="kwrd"&gt;Note that this control needs to be within your Form otherwise it&amp;#39;s values will not be submitted of course...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kwrd"&gt;When you have the control, you&amp;#39;ll need to make it submit the Form it&amp;#39;s in. I chose to do so with jQuery, but you could &lt;a href="http://weblogs.asp.net/jdanforth/archive/2008/08/28/auto-postback-with-javascript-in-asp-net-mvc.aspx" target="_blank"&gt;do it with plain javascript&lt;/a&gt; too:&lt;/span&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;#39;text/javascript&amp;#39;&lt;/span&gt;\&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="csharpcode"&gt;  $(&lt;span class="str"&gt;&amp;#39;#dropDown&amp;#39;&lt;/span&gt;).change(&lt;span class="kwrd"&gt;function&lt;/span&gt; () {&lt;br /&gt;    $(&lt;span class="kwrd"&gt;this&lt;/span&gt;).parents(&lt;span class="str"&gt;&amp;#39;form&amp;#39;&lt;/span&gt;).submit();&lt;br /&gt;  });&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;For those of you not fully up to speed with jQuery: this code finds the element named &amp;quot;dropDown&amp;quot; and adds a handler to the onChange event of it. The handler first finds the parent of the DropDownList with elementname &amp;quot;form&amp;quot;, and submits it.&lt;/p&gt;
&lt;p&gt;You could also change the action of the form here in the handler if that might be needed, for example to fire a specific controller action for the postback of the DropDownList.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1675241" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category><category domain="http://msmvps.com/blogs/superska/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>Visual Studio Coloring Scheme</title><link>http://msmvps.com/blogs/superska/archive/2008/11/26/visual-studio-coloring-scheme.aspx</link><pubDate>Wed, 26 Nov 2008 08:49:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1655104</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1655104</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/11/26/visual-studio-coloring-scheme.aspx#comments</comments><description>&lt;p&gt;I’ve been noticing quite a few developers start to change the default coloring scheme of Visual Studio to “something darker”. It’s supposed to be more relaxing for your eyes and hey… we all want to be relaxed while coding, right? I mean, we don’t want it to start to look like working. &lt;p&gt;Well, today I found myself a few minutes to browse for a nice coloring scheme to use myself. Tried to find a few a bit Blend-ish, but found most somewhat too colorful. Too much contrast doesn’t feel all that right to me. &lt;p&gt;Eventually I decided to stick with &lt;a href="http://www.canerten.com/my-visual-studio-color-scheme-friendly-ide/" target="_blank"&gt;this one&lt;/a&gt; for a while, not in the last place because it has&amp;nbsp; some settings to make &lt;a href="http://www.jetbrains.com/resharper/" target="_blank"&gt;Resharper&lt;/a&gt; fit in nicely. Besides that, the colors seem bright at first, but are well chosen. I did change some font sizes from rather large to rather small (like for the Output Window), downloadable below. &lt;/p&gt; &lt;p&gt;I should try and see how many hours I can work without taking a break with these colors &lt;img alt="Nerd" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/49_49.gif" /&gt;.&lt;/p&gt; &lt;p&gt;Anyway: here&amp;#39;s screenshot: &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska.VisualStudioColoringScheme_5F00_8A28/image_5F00_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="243" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska.VisualStudioColoringScheme_5F00_8A28/image_5F00_thumb.png" width="244" border="0" /&gt;&lt;/a&gt;  &lt;p&gt;And here&amp;#39;s the download from my Sky Drive: &lt;p&gt;&lt;iframe style="border-right:#dde5e9 1px solid;padding-right:0px;border-top:#dde5e9 1px solid;padding-left:0px;padding-bottom:0px;margin:3px;border-left:#dde5e9 1px solid;width:240px;padding-top:0px;border-bottom:#dde5e9 1px solid;height:66px;background-color:#ffffff;" src="http://cid-7459ada2048d9e82.skydrive.live.com/embedrowdetail.aspx/Public/Friendly|_IDE|_2008%20-%20SuperSKa.zip" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Have fun!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1655104" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Run as Administrator</title><link>http://msmvps.com/blogs/superska/archive/2008/11/01/run-as-administrator.aspx</link><pubDate>Sat, 01 Nov 2008 12:02:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1652750</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1652750</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/11/01/run-as-administrator.aspx#comments</comments><description>&lt;p&gt;So, finally, about 8 months after I had my laptop upgraded from 2 to 4 GB of memory, I found the time to install Vista 64-bit. Finally the 4th gig will be used too.&lt;/p&gt; &lt;p&gt;This time, as opposed to last time, I decided to keep UAC enabled. Now, there are of course some applications I always want to run as an Administrator. The fist one I encountered, not very surprisingly, was Visual Studio.&lt;/p&gt; &lt;p&gt;Luckily, there&amp;#39;s this very simple trick in Vista, that allows you to always run an application as an Administrator:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Open Explorer and browse to the executable file for the application&lt;/li&gt; &lt;li&gt;Right click the executable en choose Properties&lt;/li&gt; &lt;li&gt;Click on the Compatibility tab&lt;/li&gt; &lt;li&gt;Check the &amp;quot;Run this program as an administrator&amp;quot; checkbox:&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska.RunasAdministrator_5F00_B76F/image_5F00_5.png" width="383" border="0" /&gt;&lt;/p&gt; &lt;p&gt;You will get prompted for consent on running the application elevated, but I&amp;#39;m happy.&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:ddabda7c-f2c4-48a0-a34b-30cc96fe5b60" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Windows%20Vista" rel="tag"&gt;Windows Vista&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652750" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/Windows+Vista/default.aspx">Windows Vista</category></item><item><title>Streaming images from aspx page</title><link>http://msmvps.com/blogs/superska/archive/2008/08/13/streaming-images-from-aspx-page.aspx</link><pubDate>Wed, 13 Aug 2008 08:42:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644490</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1644490</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/08/13/streaming-images-from-aspx-page.aspx#comments</comments><description>&lt;p&gt;I know, not a very advanced topic, but still one of those things you need every now and then. And when you need it, it&amp;#39;s a good thing that the solution is all over the Internet. And now it&amp;#39;s on my blog too &lt;img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif" /&gt;.&lt;/p&gt; &lt;p&gt;Using a Handler for this would probably have been the more beautiful solution, but this one (with an aspx page) works fine too. Default.aspx only contains an asp:Image control. The Image control has it&amp;#39;s source set to Image.aspx. Image.aspx, in turn, draws a blue rectangle with a red square in it (pretty neat, huh?) &lt;img alt="Hot" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/shades_smile.gif" /&gt;:&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;private Bitmap drawImage()
{
    //Create a bitmap
    Bitmap bmp = new Bitmap(100, 100);

    //Get the Graphics object from the bitmap (using it&amp;#39;s Image base)
    Graphics g = Graphics.FromImage((System.Drawing.Image)bmp);

    //Color it blue
    g.FillRectangle(new Pen(Color.Blue).Brush, 0, 0, 100, 100);
    //Draw the red rectangle
    g.DrawRectangle(new Pen(Color.Red), new Rectangle(5, 5, 90, 90));

    //and we&amp;#39;re done
    return bmp;
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, in the Page_Load event, the image is streamed to the browser:&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;protected void Page_Load(object sender, EventArgs e)
{
    //Clear the responsestream, just to be sure.
    Response.Clear();
    //Set the Responsetype
    Response.ContentType = &amp;quot;image/jpeg&amp;quot;;
    //Save the dynamicly generated bitmap to the OutpuStream
    drawImage().Save(Response.OutputStream, ImageFormat.Jpeg);

    //End we&amp;#39;re done.
    Response.End();

}
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;It&amp;#39;s as simple as that. &lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:18d43e01-4549-4fde-8ca6-c7b4b7385fac:8b6b99cc-3283-496e-8842-ee4577bac2b6" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;&lt;p&gt;Download Solution - &lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/superska.Streamingimagesfromaspxpage_5F00_9643/ImageStreamer_5F00_10.zip"&gt;ImageStreamer.zip&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644490" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>SDN Event June 23rd</title><link>http://msmvps.com/blogs/superska/archive/2008/06/25/sdn-event-june-23rd.aspx</link><pubDate>Wed, 25 Jun 2008 15:48:40 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1637595</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1637595</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/06/25/sdn-event-june-23rd.aspx#comments</comments><description>&lt;p&gt;It was that time again last Monday. Another great &lt;a href="http://www.sdn.nl/Default.aspx?tabid=304" target="_blank"&gt;SDN Event&lt;/a&gt; by &lt;a href="http://www.sdn.nl" target="_blank"&gt;SDN&lt;/a&gt;. As usual there was a full DotNetNuke track. And, also as usual, a whole lot of other great content. Besides doing a session myself &lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="76" alt="image" src="http://msmvps.com/blogs/superska/WindowsLiveWriter/SDNEventJune23rd_FA77/image_3.png" width="400" align="left" border="0" /&gt;- on custom development for DotNetNuke other then just modules - I went to a session by Robert-Jan Tuit on Silverlight 2. Not to much news for me there, but it was good to see the stuff working again. Didn&amp;#39;t have much time for that myself lately...&lt;/p&gt; &lt;p&gt;Anyway, this was the last SDN Event before SDN Conference and Openforce Europe so we are now focusing 100% on &lt;a href="http://www.sdc.nl" target="_blank"&gt;that great event, coming up in October&lt;/a&gt;. Registration is open already by the way. See you there, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1637595" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/Events/default.aspx">Events</category><category domain="http://msmvps.com/blogs/superska/archive/tags/DotNetNuke/default.aspx">DotNetNuke</category><category domain="http://msmvps.com/blogs/superska/archive/tags/SDN/default.aspx">SDN</category></item><item><title>The custom tool 'MSLinqToSQLGenerator' failed</title><link>http://msmvps.com/blogs/superska/archive/2008/06/22/the-custom-tool-mslinqtosqlgenerator-failed.aspx</link><pubDate>Sun, 22 Jun 2008 07:30:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1636636</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1636636</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/06/22/the-custom-tool-mslinqtosqlgenerator-failed.aspx#comments</comments><description>&lt;p&gt;&amp;quot;Oh darn... it&amp;#39;s &lt;em&gt;one of those&lt;/em&gt; again&amp;quot;. That was there first thing I thought recently when all-of-a-sudden I got an error in VS2008 after trying to open up a generated DBML file in the Object Relational Designer:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;quot;The operation could not be completed.&amp;quot;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Now that&amp;#39;s helpful, isn&amp;#39;t it? After a bit of digging in the output window I also found this one:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;quot;The custom tool &amp;#39;MSLinqToSQLGenerator&amp;#39; failed.&amp;nbsp; Could not retrieve the current project.&amp;quot;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The part about the custom tool lead me to think it would probably be an issue with an AddIn. But unfortunately, the AddIn manager in VS2008 doesn&amp;#39;t have an entry for this tool. But still this was close to the solution. Somehow, somewhere (in a galaxy far, far away) Visual Studio encountered an error in the tool and must have marked it not be started again. Ever.&lt;/p&gt; &lt;p&gt;Anyway: In the registry, I deleted all subkeys below &lt;em&gt;HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Packages &lt;/em&gt;and it worked like a blast again.&lt;/p&gt; &lt;p&gt;Thanks to &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2461259&amp;amp;SiteID=1" target="_blank"&gt;this post on the MSDN forums&lt;/a&gt;.&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:58a06727-87b6-490b-9475-e0445790a897" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/LINQ" rel="tag"&gt;LINQ&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual%20Studio%202008" rel="tag"&gt;Visual Studio 2008&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1636636" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Weblog Moved Again</title><link>http://msmvps.com/blogs/superska/archive/2008/04/19/weblog-moved-again.aspx</link><pubDate>Sat, 19 Apr 2008 01:02:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1594934</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1594934</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/04/19/weblog-moved-again.aspx#comments</comments><description>&lt;p&gt;Just recently I realized I hadn&amp;#39;t moved my blog for almost 6 months. That needed to change, didn&amp;#39;t it &lt;img alt="Nerd" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/49_49.gif" /&gt;?&lt;/p&gt; &lt;p&gt;Well, actually, my previous blog was on my own &lt;a href="http://blog.superska.net/post/2007/11/Moving-To-A-Virtual-Private-Server.aspx" target="_blank"&gt;Virtual Private Server&lt;/a&gt; which doesn&amp;#39;t have a really good availability (but more on that later on, probably). Receiving the MVP award &lt;img alt="Party" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/74_74.gif" /&gt; gave me the opportunity to host my blog at &lt;a href="http://msmvps.com/"&gt;MSMVPS.COM&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;So that&amp;#39;s what I did... I&amp;#39;m still debating wether or not to move my previous blogs and actually also which one to choose eventually. So I&amp;#39;ll have to see about that...&lt;/p&gt; &lt;p&gt;Anyway, I hope you&amp;#39;ll be keeping an eye on my blog. I&amp;#39;ll be trying to be a more regular blogger here &lt;img alt="Angel" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/angel_smile.gif" /&gt; ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1594934" width="1" height="1"&gt;</description></item><item><title>Wow!!! MVP Award 2008</title><link>http://msmvps.com/blogs/superska/archive/2008/04/01/wow-mvp-award-2008.aspx</link><pubDate>Tue, 01 Apr 2008 14:49:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1594927</guid><dc:creator>Stefan Kamphuis</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/superska/rsscomments.aspx?PostID=1594927</wfw:commentRss><comments>http://msmvps.com/blogs/superska/archive/2008/04/01/wow-mvp-award-2008.aspx#comments</comments><description>&lt;p&gt;So, I admit, it took me a week to be able to look away from that fantastic email I got on April 1st. It was the e-mail with the subject:&lt;/p&gt; &lt;h3&gt;Congratulations! You have received the Microsoft MVP Award&lt;/h3&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/superska/WindowsLiveWriter/WowMVPAward2008_A8A5/MVP_Horizontal_FullColor_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="134" alt="MVP_Horizontal_FullColor" src="http://msmvps.com/blogs/superska/WindowsLiveWriter/WowMVPAward2008_A8A5/MVP_Horizontal_FullColor_thumb.png" width="332" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;At first there was this thought about April Fools of course, but pretty soon (actually, when I had been able to login on the mvp website) I realized it is for real: Í am an MVP on the subject of ASP/ASp.NET now.&lt;/p&gt; &lt;p&gt;Enough blogging for now, back to my email &lt;img alt="Open-mouthed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/teeth_smile.gif" /&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1594927" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/superska/archive/tags/MVP/default.aspx">MVP</category></item></channel></rss>