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

<channel>
	<title>ByteCyclist.com &#187; MVC</title>
	<atom:link href="http://www.bytecyclist.com/tag/mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bytecyclist.com</link>
	<description>A site made of bytes by a cyclist.</description>
	<lastBuildDate>Fri, 14 Aug 2009 04:46:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>jMonthCalendar: Minor Release 1.2.0</title>
		<link>http://www.bytecyclist.com/2009/02/12/jmonthcalendar-minor-release-120/</link>
		<comments>http://www.bytecyclist.com/2009/02/12/jmonthcalendar-minor-release-120/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 19:04:52 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[jMonthCalendar]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=174</guid>
		<description><![CDATA[Wow, let me first start by saying it has been too long since I posted any updates on jMonthCalendar. I hope that the new release of jMonthCalendar 1.2.0 excites you as much as it does me. 1.2.0 sets the stage &#8230; <a href="http://www.bytecyclist.com/2009/02/12/jmonthcalendar-minor-release-120/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow, let me first start by saying it has been too long since I posted any updates on jMonthCalendar.  I hope that the new release of jMonthCalendar 1.2.0 excites you as much as it does me.  1.2.0 sets the stage for some pretty cool stuff. Continue reading to see a short list of the new features and where this project is going next.<br />
<span id="more-174"></span><br />
On the short list of new features there is:</p>
<ul>
<li>Today Link (navigate back to today&#8217;s date)</li>
<li>Year navigation, jump to &#8217;10 or back to &#8217;08 in the active month</li>
<li>Ability to click a day cell or day link and fire your own custom logic (i.e. add event on that day)</li>
<li>JSON date parsing, parse what some from that event object if the calendar is un-aware.</li>
<li>Fixed in-line sizing, configurable by options conscruct</li>
<li>Deprecating Date property, replaced by StartDate</li>
<li>Added EndDate property to event object</li>
</ul>
<p>While not all of all of them seem flashy, the last three or four points make the calendar that much closer to having multi-day events and event overflow support.</p>
<p>I am happy to report that I am currently using the calendar on an ASP.Net MVC site on my development machine.  I hope to have a new calendaring system ready soon.  This should concern you only because when I find issues while developing and using it, I fix them and everyone benefits.  In more detail my calendar does a JSON GetData call to a controller actions, which executes and returns JSON formatted events.  I am using <a href="http://james.newtonking.com/projects/json-net.aspx" target="_blank">James Newton-King&#8217;s JSON.Net</a> library to map and serialize my C# objects.  I use the attributes on my properties to rename or exclude them from serialization.  Very nice library and commend James for the work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2009/02/12/jmonthcalendar-minor-release-120/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC Release Canidate</title>
		<link>http://www.bytecyclist.com/2009/01/29/aspnet-mvc-release-canidate/</link>
		<comments>http://www.bytecyclist.com/2009/01/29/aspnet-mvc-release-canidate/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 17:54:49 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=159</guid>
		<description><![CDATA[If you didn&#8217;t know already, ASP.Net MVC framework is int he release candidate stages. Wahoo!!!. As per usual ScottGu over at Microsoft posted insanely detailed remarks on the new features. Check it out here.. Some notable improvements that I have &#8230; <a href="http://www.bytecyclist.com/2009/01/29/aspnet-mvc-release-canidate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you didn&#8217;t know already, ASP.Net MVC framework is int he release candidate stages. Wahoo!!!. As per usual ScottGu over at Microsoft posted insanely detailed remarks on the new features. <a href="http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx">Check it out here.</a>. Some notable improvements that I have used and like thus far include NO MORE CODE BEHIND FILES (this is my favorite), shortcut&#8217;s to switch between views and controllers, and &#8220;scaffold&#8221; like generation of views and controllers using the T4 template engine in Visual Studio.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2009/01/29/aspnet-mvc-release-canidate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jMonthCalendar: A jQuery Event Calendar</title>
		<link>http://www.bytecyclist.com/2009/01/18/jmonthcalendar-a-jquery-event-calendar/</link>
		<comments>http://www.bytecyclist.com/2009/01/18/jmonthcalendar-a-jquery-event-calendar/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 18:46:43 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[jMonthCalendar]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=129</guid>
		<description><![CDATA[While working on a project conversion to MVC I realized I needed a full month calendar that supported events. None existed so I spent a few evenings learning jQuery and developing my own. I just recently posted new pages on &#8230; <a href="http://www.bytecyclist.com/2009/01/18/jmonthcalendar-a-jquery-event-calendar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While working on a project conversion to MVC I realized I needed a full month calendar that supported events.  None existed so I spent a few evenings learning jQuery and developing my own.  I just recently posted new pages on the project and submitted the plugin to jQuery.<br />
<span id="more-129"></span><br />
Recently I have been working on a re-architecture of <a href="http://www.pertnearsandstone.com">PertNearSandstone.com</a>.  I have been converting the project into a full MVC application (previously Webforms).  Part of the application features displaying upcoming events/shows on a calendar for visitors.  In the previous Webforms world this was easy, I could throw an Asp.Net Calendar on the page and tie into the instances events to display what I wanted on the calendar.  Well MVC does not like the runat tag and thus can not use the same control in the new app.</p>
<p>I searched the web for a replacement, I thougt that someone would have made something to fulfill this requirement.  All I could find were Javascript pop-up calendar like the ones you see next to input fields.  Since I couldn&#8217;t find one I thought I would start on my own adventure into learning jQuery (since I have heard good things about it) and creating my own.  That is where I cam up with <a href="http://www.bytecyclist.com/projects/jmonthcalendar">this</a> full month calendar that can display events and provide some minor extension points for custom code.</p>
<p>Overall I am very pleased and excited about this.  This is close to my first sole open source project and is a major accomplishment for my JavaScript skills; not to mention that I was successfully able to learn jQuery and develop a plugin for it.  I am giving back to the jQeury commnity who helped me out, if you would like a copy of this please visit <a href="http://plugins.jquery.com/project/jMonthCalendar">jMonthCalendar jQuery Plugin page</a>.  To see code samples and demos of the plugin please visit my projects page <a href="http://www.bytecyclist.com/projects/jmonthcalendar">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2009/01/18/jmonthcalendar-a-jquery-event-calendar/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC &#8220;Areas/Modules&#8221;</title>
		<link>http://www.bytecyclist.com/2008/12/03/aspnet-mvc-areasmodules/</link>
		<comments>http://www.bytecyclist.com/2008/12/03/aspnet-mvc-areasmodules/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:40:57 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Modules]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=75</guid>
		<description><![CDATA[In this post Phil Haack explains how Areas can be accomplished in the ASP.Net MVC framework. I really like this idea of have Areas or Modules in ASP.Net MVC.  I have been in the process of developing a Forum for &#8230; <a href="http://www.bytecyclist.com/2008/12/03/aspnet-mvc-areasmodules/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx" target="_blank">In this post Phil Haack explains how Areas can be accomplished in the ASP.Net MVC framework.</a></p>
<p>I really like this idea of have Areas or Modules in ASP.Net MVC.  I have been in the process of developing a Forum for a website and came across this after I was complete.  I thought that &#8220;yes it would be nice to use this same logic in another application&#8221;, and having an areas or module to move around would be quite nice.<br />
<span id="more-75"></span><br />
One thing I would expand upon is the idea of creating a self contained binary (dll) that can be referenced into the main project.  This would mean that all the views and resources would have to be staticly defined in the binary, but could be easily re-styled with CSS.  You&#8217;d probably also have to define a configuration element in your web.config that defines database connections and other information important/configurable to the Module/Area.</p>
<p>We&#8217;ll see how time permits for a prototype.  Not something I <span style="text-decoration: underline;">need</span> now but is cool to think of.  I wish the ASP.Net MVC guys/gals would include this functionality of segragated sections/areas/modules in a future release of ASP.Net MVC</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2008/12/03/aspnet-mvc-areasmodules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC Route Table Ordering</title>
		<link>http://www.bytecyclist.com/2008/10/27/aspnet-mvc-route-table-ordering/</link>
		<comments>http://www.bytecyclist.com/2008/10/27/aspnet-mvc-route-table-ordering/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 20:20:34 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=56</guid>
		<description><![CDATA[Over the past few weeks I have been working on an MVC forum component for a website I maintain/develop (http://pertnearsandstone.com).  As I was working through the various screens I would set up the intended routes to the route table in &#8230; <a href="http://www.bytecyclist.com/2008/10/27/aspnet-mvc-route-table-ordering/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Over the past few weeks I have been working on an MVC forum component for a website I maintain/develop (<a href="http://pertnearsandstone.com" target="_blank">http://pertnearsandstone.com</a>).  As I was working through the various screens I would set up the intended routes to the route table in my global.ascx.cs file only to learn that route ordering is very important. The order of the routes affects the flow and logic of your application.<br />
<span id="more-56"></span><br />
To start off I had something like this working.  I could get to all my views and actions as expected.  Could get to the post/reply system as well and the index of topics and thread pages.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Index&quot;</span>, <span style="color: #666666;">&quot;Forum&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Index&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-CreatePost&quot;</span>, <span style="color: #666666;">&quot;Forum/Create&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Create&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-NewPost&quot;</span>, <span style="color: #666666;">&quot;Forum/Post/{ParentThreadID}/{ParentPostID}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;New&quot;</span>, ParentThreadID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, ParentPostID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Thread&quot;</span>, <span style="color: #666666;">&quot;Forum/Thread/{threadId}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Thread&quot;</span>, threadId <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Then I wanted to add paging to the index (topics) page so I implemented the logic in my controllers and added the helper to the view.  I also updated my routes to accept the new page as seen below:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Index&quot;</span>, <span style="color: #666666;">&quot;Forum/{page}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Index&quot;</span>, page <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-CreatePost&quot;</span>, <span style="color: #666666;">&quot;Forum/Create&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Create&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-NewPost&quot;</span>, <span style="color: #666666;">&quot;Forum/Post/{ParentThreadID}/{ParentPostID}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;New&quot;</span>, ParentThreadID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, ParentPostID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Thread&quot;</span>, <span style="color: #666666;">&quot;Forum/Thread/{threadId}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Thread&quot;</span>, threadId <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>I tested everything out and found that the paging was working correctly but everything else had broken, except the thread page.  I spent entirely too much time on this issue to find out thanks to <a href="http://weblogs.asp.net/scottgu/default.aspx" target="_blank">Scott Guthrie</a> and his <a href="http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx" target="_blank">URL Routing Post</a> that I had an issue with how my routes were ordered.  In his post I re-learned that routes must be in order from most specific to least specific.  Obviously my new paging parameter was catching my Create route and my Post route when no data was being sent additionally (/Forum/Post/0/0 works, /Forum/Post did not).  I changed the order of my routes like below and everything worked as expected.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-CreatePost&quot;</span>, <span style="color: #666666;">&quot;Forum/Create&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Create&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-NewPost&quot;</span>, <span style="color: #666666;">&quot;Forum/Post/{ParentThreadID}/{ParentPostID}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;New&quot;</span>, ParentThreadID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, ParentPostID <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Thread&quot;</span>, <span style="color: #666666;">&quot;Forum/Thread/{threadId}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Thread&quot;</span>, threadId <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
routes.<span style="color: #0000FF;">MapRoute</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Forum-Index&quot;</span>, <span style="color: #666666;">&quot;Forum/{page}&quot;</span>,
    <span style="color: #008000;">new</span> <span style="color: #000000;">&#123;</span> controller <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Forum&quot;</span>, action <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Index&quot;</span>, page <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>If you are reading this entry and know of a way to a) either check to see if the parameter can be parsed as an int (as in page index) and match the route, similar to a constraint or b) an easy way to test the routes.  I would greatly appreciate any feedback, comments, or sample code of your solutions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2008/10/27/aspnet-mvc-route-table-ordering/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Frustrating IIS7 Configuration 500 Error</title>
		<link>http://www.bytecyclist.com/2008/09/22/frustrating-iis7-configuration-500-error/</link>
		<comments>http://www.bytecyclist.com/2008/09/22/frustrating-iis7-configuration-500-error/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 18:13:05 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[IIS7]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.bytecyclist.com/?p=19</guid>
		<description><![CDATA[Recently I have been putting a lot of my evenings and weekends in to a re-architecting of a site I host and develop for some friends of mine Pert&#8217; Near Sandstone. The Entire site is built using ASP.Net and features &#8230; <a href="http://www.bytecyclist.com/2008/09/22/frustrating-iis7-configuration-500-error/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I have been putting a lot of my evenings and weekends in to a re-architecting of a site I host and develop for some friends of mine <a title="Pert Near Sandstone" href="http://www.pertnearsandstone.com" target="_blank">Pert&#8217; Near Sandstone.</a> The Entire site is built using ASP.Net and features a standard (web forms) website front end (public facing) and an admin side also built using web forms.  I liked this at the time, but it soon became very difficult to debug, maintain and add features to.</p>
<p>The biggest factor in deciding the re-architect the site at the time was the lack of interoperability in the Admin side/application.  It worked as intended about 60% of the time (60% of the time it works every time).  The web forms admin side required a lot of code that was spread out over numerous code behind files, making it difficult to maintain.  Not to mention similar logic was being duplicated, violating the DRY principal (don&#8217;t repeat yourself).</p>
<p>Around the same time I had just finished my exploration of the new ASP.Net MVC (model-view-controller) model and had fallen in love with web development all over again.  I had been in the process of creating some sample applications with it.  I even started testing how it deployed on various web hosting platforms.  I discovered that the MVC pattern DID work on IIS6 and IIS7.  The URL&#8217;s on IIS6 required special mapping (either adding .aspx or .mvc to map to the aspnet framework), I didn&#8217;t like that so I found a host that offered IIS7.  The URL&#8217;s are now clean and to my liking.  MVC makes sense, it creates clean separation of UI, business logic and data models. and will be an architecture of choice on ASP.Net.</p>
<p>So to make my long story short and to the point.  I ended up re-architecting the Admin (once web forms side) of my site/project into a new MVC project in my solution.  I started bringing over functionality one peice at a time, while reworking the underlying business logic and data access logic into various providers and repositories.  I had everything working perfectly for a phase one deployment to the web host.  I had 2 projects to deploy, one public facing site (web forms) and one admin MVC site.  I set up the web host to use a virtual directory for the the MVC site, configured my connection strings as:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;connectionStrings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- PRD --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PertNear.Data.Properties.Settings.PertNearSandstoneConnectionString&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;server=secureserver.net;uid=user;pwd=pass;database=db&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PertNear.Membership&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">connectionString</span>=<span style="color: #ff0000;">&quot;server=secureserver.net;uid=user;pwd=pass;database=db&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">providerName</span>=<span style="color: #ff0000;">&quot;System.Data.SqlClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!--</span>
<span style="color: #808080; font-style: italic;">    &lt;!--  DEV</span>
<span style="color: #808080; font-style: italic;">    &lt;add name=&quot;PertNear.Data.Properties.Settings.PertNearSandstoneConnectionString&quot;</span>
<span style="color: #808080; font-style: italic;">connectionString=&quot;Data Source=localhost;Initial Catalog=DB;Integrated Security=True&quot;</span>
<span style="color: #808080; font-style: italic;">providerName=&quot;System.Data.SqlClient&quot; /&gt;</span>
<span style="color: #808080; font-style: italic;">    &lt;add name=&quot;PertNear.Membership&quot;</span>
<span style="color: #808080; font-style: italic;">connectionString=&quot;Data Source=localhost;Initial Catalog=DB;Integrated Security=True&quot;</span>
<span style="color: #808080; font-style: italic;">providerName=&quot;System.Data.SqlClient&quot; /&gt;</span>
<span style="color: #808080; font-style: italic;">    --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/connectionStrings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>I uploaded everything to the virtual directory and tried to access the new applications.  The public facing side (web forms) worked cause it had a separate config file, the admin side through the generic IIS7 internal server error with no messages.  I looked everywhere to find a solution.  Many sources said to add a wrapping element around the parent web.config so that it&#8217;s settings don&#8217;t conflict with the virtual directories (inheritance in IIS7 config files). I spent a week plus on this issue until I ran the config file through an XML validator.  As you can see I had a rouge comment tag in the config.  Had I known that IIS7 was first validating my config file I might have gotten an error along the lines of &#8220;invalid xml&#8221; instead of generic 500 error.</p>
<p>Reader be warned, be sure the validate the web.config file before uploading.  And check the config file before you make any drastic changes like I did (I moved the MVC project into the public facing site to now have just one project to deploy, thinking that might solve the issue).  One point worth mentioning, I had edited my published web.config outside of VS2008 in a text editor, hopefully VS would have caught that error for me had I known.</p>
<p>Good luck, happy coding and avoid the frustration I had.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bytecyclist.com/2008/09/22/frustrating-iis7-configuration-500-error/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
