<?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>Ten Tonne Baby &#187; asp.net</title>
	<atom:link href="http://www.tentonnebaby.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tentonnebaby.com</link>
	<description>Discussion on Web Technologies, Design and London</description>
	<lastBuildDate>Thu, 19 Jan 2012 09:33:30 +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>Dynamic image endpoints &#8211; think about conditional GETs</title>
		<link>http://www.tentonnebaby.com/2010/02/26/dynamic-image-endpoints-think-about-conditional-gets/</link>
		<comments>http://www.tentonnebaby.com/2010/02/26/dynamic-image-endpoints-think-about-conditional-gets/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 10:35:51 +0000</pubDate>
		<dc:creator>Oli</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[images]]></category>

		<guid isPermaLink="false">http://www.tentonnebaby.com/2010/02/26/dynamic-image-endpoints-think-about-conditional-gets/</guid>
		<description><![CDATA[I’ve been looking at an issue recently on a site where there is a dynamic endpoint that serves up an image that is stored in a SQL database. The endpoint added the Cache-control: public header, so on the face of it looked like it had added client-side caching support.
By default if you don’t send either [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been looking at an issue recently on a site where there is a dynamic endpoint that serves up an image that is stored in a SQL database. The endpoint added the Cache-control: public header, so on the face of it looked like it had added client-side caching support.</p>
<p>By default if you don’t send either Cache-Control: max-age, or Expires headers then the user agent has been told that the resource can be cached, but has no way to know whether it has changed on the server. Based on this the user agent will send a conditional GET request to the server to find out if the resource has changed, or if it can be served directly from the local cache (this would look like a 304 response).</p>
<p>A conditional GET will compare versions of a resource based on either the Last-Modified header, or the ETag header. Generally these would have been sent in the original response for a resource. The client will then send either the If-None-Match, or If-Modified-Since headers in the GET request to indicate the resource should ONLY be sent by the server if it has changed.</p>
<p>In this case the dynamic endpoint had not been coded to support conditional GETs, so the images were getting fully downloaded on each request as a 200 response.</p>
<p>The simplest solution is to send Cache-control: max-age in order to allow the user agent to serve the resource directly from the cache without bothering with a conditional GET. Alternatively the endpoint has to check for conditional GET requests and change it’s behaviour to support sending a 304 response if the image hasn’t changed.</p>
<p>The best diagnostic tool to see what is going on is the Net tab in Firebug. This will allow you to check the request and response headers, the response codes, and user agent caching behaviour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tentonnebaby.com/2010/02/26/dynamic-image-endpoints-think-about-conditional-gets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring a virtual application within an ASP.NET MVC site</title>
		<link>http://www.tentonnebaby.com/2009/06/01/configuring-a-virtual-application-within-an-aspnet-mvc-site/</link>
		<comments>http://www.tentonnebaby.com/2009/06/01/configuring-a-virtual-application-within-an-aspnet-mvc-site/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 16:40:37 +0000</pubDate>
		<dc:creator>Oli</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://www.embeddedstream.com/2009/06/01/configuring-a-virtual-application-within-an-aspnet-mvc-site/</guid>
		<description><![CDATA[I recently had to look into how to get requests to /TestApp within an ASP.NET MVC site resolving to another application, instead of picking up the default routing rule and trying to find the Index action on a TestApp controller class. A scenario where this may occur would be setting up a wiki application to [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to look into how to get requests to /TestApp within an ASP.NET MVC site resolving to another application, instead of picking up the default routing rule and trying to find the Index action on a TestApp controller class. A scenario where this may occur would be setting up a wiki application to run on /wiki off your main domain name.</p>
<p>First off, we need to ensure that the routing module doesn’t kick in and attempt to handle the request. This can be achieved by making the following change in global.asax of the MVC app…</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 35px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">routes.IgnoreRoute(<span style="color: #006080">&quot;{*path}&quot;</span>, <span style="color: #0000ff">new</span> { path = <span style="color: #006080">@&quot;TestApp\/(.*)&quot;</span> });</pre>
</div>
<p>You can then create a new virtual directory in IIS under the main site, and convert it into an application to ensure it’s running in a seperate AppPool etc.</p>
<p>The final step is to ensure that web application settings in the parent application don’t cascade and get applied to the child application. This is achieved by wrapping all of the main configuration in a location block, and setting inheritInChildApplications to false like so…</p>
<div style="border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px">
<pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&lt;location path=<span style="color: #006080">&quot;.&quot;</span> inheritInChildApplications=<span style="color: #006080">&quot;false&quot;</span>&gt;
   &lt;system.web&gt;Blah&lt;/system.web&gt;
   &lt;system.webServer&gt;Blah&lt;/system.webServer&gt;
&lt;/location&gt;</pre>
</div>
<p>The most useful reading on this I could find was <a href="http://forums.asp.net/p/1319012/2623590.aspx">this forum post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tentonnebaby.com/2009/06/01/configuring-a-virtual-application-within-an-aspnet-mvc-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net Markup Snob</title>
		<link>http://www.tentonnebaby.com/2006/09/06/aspmarkupsnob/</link>
		<comments>http://www.tentonnebaby.com/2006/09/06/aspmarkupsnob/#comments</comments>
		<pubDate>Wed, 06 Sep 2006 11:26:46 +0000</pubDate>
		<dc:creator>Oli</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.embeddedstream.com/2006/09/06/aspmarkupsnob/</guid>
		<description><![CDATA[I tend to get quite sad when people approach ASP.Net and can drag and drop controls and build a site without really thinking about the markup that gets sent to a client...]]></description>
			<content:encoded><![CDATA[<p>I tend to get quite sad when people approach ASP.Net and can drag and drop controls and build a site without really thinking about the markup that gets sent to a client. I know that part of their brief is to make it easier for people to build sites, but the added layer of abstraction of using a framework often means that people never gain an understanding of the underlying technologies involved.</p>
<p>I&#8217;ve seen lots of respectable developers work on sites without running validators over their work or nosing around in the markup that is generated. People will learn the interface for consuming a particular server control without ever getting near the HTML. You&#8217;ll see posts from beginners along the lines of &#8216;how do I set the src attribute on an image&#8217; &#8211; so you learn to set the ImageUrl property on the server control.</p>
<p>I tend to approach development in ASP.Net from the other direction&#8230; how can I get the framework to generate this markup that I require in the most effective way? I think there should be minimal difference between how you would author a static site, and the generated markup from a dynamic site. Otherwise you&#8217;re compromising the quality of the site to accomodate constraints from the framework that you&#8217;re using.</p>
<p>I think ASP.Net is a great framework. However I strongly believe it should be used to build custom controls that serve the specific markup needs you have for a site. Generally if you&#8217;re doing things correctly, the actual HTML is purely content and therefore very simple. It&#8217;s not actually that much effort to author nice simple custom controls that just serve your requirements and do nothing else.</p>
<p>A simple example is how all of the &#8216;free&#8217; server controls will always render an id attribute to the client &#8211; generally this will be autogenerated and long and bloated. Firstly this can interfere and make it hard to use ID based selectors in CSS, but also (more importantly) you should only render an ID attribute if you need a hook for styling or behaviour. Otherwise you&#8217;re simply bloating the stream of data that gets sent to the client, and wasting bandwidth and server resources.</p>
<p>I always tend to build a base custom control class where you can specify whether and ID should be rendered, and also whether the ID should be scoped or not. If set to true, the ClientID property gets written to the output stream (the fully qualified value), otherwise the exact ID that was set on the control. The default for rendering the ID attribute is false. This means that the markup does not get bloated with unnecessary information, and as an author you have complete control over the value that gets rendered (so using ID selectors in CSS is back on the cards).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tentonnebaby.com/2006/09/06/aspmarkupsnob/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Atlas or YUI?</title>
		<link>http://www.tentonnebaby.com/2006/07/03/atlas-or-yui/</link>
		<comments>http://www.tentonnebaby.com/2006/07/03/atlas-or-yui/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 12:16:55 +0000</pubDate>
		<dc:creator>Oli</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.embeddedstream.com/2006/07/03/atlas-or-yui/</guid>
		<description><![CDATA[For a little while I've been meaning to take a proper look at Atlas, Microsoft's main offering to help out in building AJAX applications and richer web based interfaces...]]></description>
			<content:encoded><![CDATA[<p>For a little while I&#8217;ve been meaning to take a proper look at <a href="http://atlas.asp.net">Atlas</a>, Microsoft&#8217;s main offering to help out in building <acronym title="Asynchronous Javascript and XML">AJAX</acronym> applications and richer web based interfaces.</p>
<p>Javascript is definately back in fashion, with a number of libraries popping up to help out with application development. I think overall this is fine, so long as you have an appreciation of what is actually happening under the scenes. I don&#8217;t think a library should dictate the way that you build an application, rather enable you to build it more efficiently.</p>
<p>I&#8217;ve started using elements of the <a href="http://developer.yahoo.com/yui/">Yahoo YUI library</a> which is very impressive. There seem to be a lot of very useful little utility functions available, the kind of thing that you would typically rewrite on each project.</p>
<p>I&#8217;m quite curious about how the Microsoft and Yahoo libraries compare. I&#8217;ll post some information about this when I&#8217;ve had a chance to look in more detail at Atlas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tentonnebaby.com/2006/07/03/atlas-or-yui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

