<?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>Jamie Dixon &#187; ASP.NET</title>
	<atom:link href="http://www.jamie-dixon.co.uk/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jamie-dixon.co.uk</link>
	<description>Web Developer, Software Engineer and Mixed Language Artist</description>
	<lastBuildDate>Fri, 30 Apr 2010 15:16:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visual Studio &#8211; Lost nesting of codebehind</title>
		<link>http://www.jamie-dixon.co.uk/visual-studio/visual-studio-lost-nesting-of-codebehind/</link>
		<comments>http://www.jamie-dixon.co.uk/visual-studio/visual-studio-lost-nesting-of-codebehind/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 15:13:47 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[csproj]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.jamie-dixon.co.uk/?p=219</guid>
		<description><![CDATA[We&#8217;ve all had times when we&#8217;ve created an ASP.NET webpage and then a new page is required with almost identical functionality.
I had that task today and so making things simple I copied the current files, pasted them and made the necessary changes to hook the designer and code-behind files to the aspx page.
This works perfectly. [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all had times when we&#8217;ve created an ASP.NET webpage and then a new page is required with almost identical functionality.</p>
<p>I had that task today and so making things simple I copied the current files, pasted them and made the necessary changes to hook the designer and code-behind files to the aspx page.</p>
<p>This works perfectly. The code builds, the page runs, everything happens as I expected it to.</p>
<p>Then I noticed a little quirk in Visual Studio 2008. One of the great features of Visual Studio is the way in which it visually nests code-behind files in the Solution Explorer under your aspx file.</p>
<p>After making a copy of my origional page I noticed that my code-behind was left astray. I checked all the references to make sure everything was hooked up correctly but still, my code-behind wasn&#8217;t nesting nicely under my aspx page as usual.</p>
<p>Now I&#8217;m sure many people have come across this problem before however this was a first for me.</p>
<p>It turns out that the references are stores in the csproj file. There is a reference to the code-behind file and a list of dependancies. By default, when doing a copy/paste of files outside of Visual Studio, this reference is not updated and the code-behind file doesn&#8217;t attach itself to the aspx file in the Solution Explorer.</p>
<p>The solution is to simply add a reference to the dependant aspx fie in the csproj file like so:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p219code2'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2192"><td class="code" id="p219code2"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Compile</span> <span style="color: #000066;">Include</span>=<span style="color: #ff0000;">&quot;myShinyNewFile.aspx.cs&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;DependentUpon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>myShinyNewFile.aspx<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/DependentUpon<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SubType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ASPXCodeBehind<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/SubType<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Compile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Once you&#8217;ve added the second line into the csproj file, restarting visual studio brings back the much loved nesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamie-dixon.co.uk/visual-studio/visual-studio-lost-nesting-of-codebehind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global Resource strings by property</title>
		<link>http://www.jamie-dixon.co.uk/concepts/global-resource-strings-by-property/</link>
		<comments>http://www.jamie-dixon.co.uk/concepts/global-resource-strings-by-property/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 15:10:44 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[concepts]]></category>
		<category><![CDATA[App_GlobalResources]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://www.jamie-dixon.co.uk/?p=208</guid>
		<description><![CDATA[Every now and then I come across a bunch of string literals littered through out some code and begin the task of moving them out into their own resource file (.resx).
Gaining access to these strings from C# is pretty easy however I&#8217;m yet to find anywhere explaining it the way I find simplest.
Assuming your resx [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then I come across a bunch of string literals littered through out some code and begin the task of moving them out into their own resource file (.resx).</p>
<p>Gaining access to these strings from C# is pretty easy however I&#8217;m yet to find anywhere explaining it the way I find simplest.</p>
<p>Assuming your resx file is stored in the App_GlobalResources folder, you can basically assign your resource file to a variable in your C# using the following syntax:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p208code5'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2085"><td class="code" id="p208code5"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">Res </span><span style="color: #008000;">=</span> Resources<span style="color: #008000;">.</span><span style="color: #0000FF;">MyResourceFile</span></pre></td></tr></table></div>

<p>This then gives you the ability to referene the contents of the resource file as properties in your code.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p208code6'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2086"><td class="code" id="p208code6"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">string</span> x <span style="color: #008000;">=</span> Res<span style="color: #008000;">.</span><span style="color: #0000FF;">OneOfMyStringNames</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.jamie-dixon.co.uk/concepts/global-resource-strings-by-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft ASP.NET MVC</title>
		<link>http://www.jamie-dixon.co.uk/technology/microsoft-aspnet-mvc/</link>
		<comments>http://www.jamie-dixon.co.uk/technology/microsoft-aspnet-mvc/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:45:48 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.jamie-dixon.co.uk/?p=56</guid>
		<description><![CDATA[Microsoft ASP.NET MVC is the latest technology from Microsoft that has been built on top of the ASP.NET 3.5 framework.
Microsoft Says:
ASP.NET MVC enables you to build Model View Controller (MVC) applications by using the ASP.NET framework. ASP.NET MVC is an alternative, not a replacement, for ASP.NET Web Forms that offers the following benefits:

Clear separation of [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft ASP.NET MVC is the latest technology from Microsoft that has been built on top of the ASP.NET 3.5 framework.</p>
<p>Microsoft Says:</p>
<blockquote><p>ASP.NET MVC enables you to build Model View Controller (MVC) applications by using the ASP.NET framework. ASP.NET MVC is an alternative, not a replacement, for ASP.NET Web Forms that offers the following benefits:</p>
<ul>
<li>Clear separation of concerns</li>
<li>Testability &#8211; support for Test-Driven Development</li>
<li>Fine-grained control over HTML and JavaScript</li>
<li>Intuitive URLs</li>
</ul>
<p>Source: <em><a href="http://www.asp.net/mvc/">http://www.asp.net/mvc/</a></em></p></blockquote>
<p>There&#8217;s a lot to be said about ASP.NET MVC and so far, I&#8217;m only just scratching the surface of what&#8217;s possible with this new technology.</p>
<p><span id="more-56"></span></p>
<h3>Where can I get Microsoft ASP.NET MVC?</h3>
<p>Version 1.0 has just been released and you can get it here: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;displaylang=en" target="_blank">Download Microsoft ASP.NET MVC<br />
</a></p>
<h3>So what&#8217;s the point?</h3>
<p>For some time now I&#8217;ve held that position that ASP.NET is one of the most powerful frameworks around for building web applications but there&#8217;s just something missing. That something, to me, has been the level of control that ASP.NET has offered upto this point . Not only with the way many of the controls render crappy HTML output but also in the way the presentation layer was handled all-together.</p>
<p>Coming from a front-end background originally and having been around and learning during the majority of the cross over from invalid table based design to the more modern CSS and semantics based web of today, I&#8217;ve always been extremely picky about what my code outputs. Having also been a bit of a perfectionist for most of my life, the concept of MVC (Model-View-Controller) has always been something that appealed to me and in the early days of doing ASP 3.0 (classic ASP)  I spent a couple of months developing my own framework which might now be referred to as a type of templating system. HTML in HTML files, ASP in ASP files, Javascript in Javascript files, MasterPage&#8217;s&#8230;and so on.</p>
<p>Another item on my wish list for future implementations of ASP.NET was URL-Rewriting. For the past 6 years I&#8217;ve been using ISAPI Rewrite to manage and manipulate URLs in order to create a clear separation between a document (or application) and it&#8217;s URI. In the olden days, people used to get married and stay together for life but these days people are more free to choose and do what makes them happy. The same is now also true in ASP.NET MVC with it&#8217;s native URL Re-Writing structure. No longer are web applications bound by their document structure but instead we now have the kind of flexibility that lets us create URLs that are intuitive and our users will understand.</p>
<p>As a proponent of TDD (Test Driven Development) I&#8217;m also really pleased to hear that ASP.NET MVC now includes support for unit testing. With nUnit integrating into Visual Studio nicely, testing has been relatively simple for some time but anything that adds to this and makes testing even easier and thus more likely to occur is a bonus. Once I&#8217;ve played around a little more with the testing support in ASP.NET MVC I&#8217;ll write more on this topic but for now, It&#8217;s good to see the Microsoft guys supporting a methodology that is not only beneficial but a real necessity in this world of high speed development and flexible working practices.</p>
<h3>Will ASP.NET MVC replace WebForms?</h3>
<p>At Microsoft they&#8217;re promoting MVC as an alternative to WebForms and not a replacement and I think this is a smart move.</p>
<p>There are many benefits to having fine-grain control over you application and there&#8217;s also a time and place to use WebForms depending on the context and variables in question. One concept I like the idea of is combining the two technologies so that you can create quick and stylish administration functionality using WebForms and then the customer facing website using MVC. I think it&#8217;s a matter of what you want to achieve and what you have available to you as a developer and as a business.</p>
<p>No doubt there will be more posts to come on Microsoft ASP.NET MVC as I delve deeper into it and learn some new things. For now, suffice to say I&#8217;m impressed and very excited about this new technology.</p>
<p>What are your thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jamie-dixon.co.uk/technology/microsoft-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
