<?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>Brant Burnett&#039;s Development Blog &#187; ASP.NET</title>
	<atom:link href="http://btburnett.com/category/aspnet/feed" rel="self" type="application/rss+xml" />
	<link>http://btburnett.com</link>
	<description></description>
	<lastBuildDate>Tue, 27 Apr 2010 12:48:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Simplify Asynchronous Javascript Loading In ASP.Net Using LABjs</title>
		<link>http://btburnett.com/2010/01/simplify-asynchronous-javascript-loading-in-asp-net.html</link>
		<comments>http://btburnett.com/2010/01/simplify-asynchronous-javascript-loading-in-asp-net.html#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:41:48 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://btburnett.com/?p=100</guid>
		<description><![CDATA[LABjs is an excellent javascript library that performs asynchronous loading of javascript files. This can help to greatly increase the load speed of your web pages. Now, instead of blocking while one file is being downloaded, other scripts further down the chain can be downloaded while waiting. On top of that, it can maintain processing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labjs.com">LABjs</a> is an excellent javascript library that performs asynchronous loading of javascript files.  This can help to greatly increase the load speed of your web pages.  Now, instead of blocking while one file is being downloaded, other scripts further down the chain can be downloaded while waiting.  On top of that, it can maintain processing order, waiting to process certain scripts until others are complete, and optionally executing code on completion.</p>
<p>All of this is great for the client side.  But how do you define which scripts to include in the LABjs chain on the server side?</p>
<p>Since for work I primarily operate in ASP.Net, I&#8217;ve created an ASP.Net solution to the problem, LABjs.Net.  This library provides two key controls, LabScriptManager and LabScriptManagerProxy.  These controls loosely follow the behavior of the AJAX ScriptManager and ScriptManagerProxy controls, at least their script loading aspects.</p>
<p>Key supported features include:</p>
<ol>
<li>Refer to script files using application relative paths (i.e. ~/js/jquery.min.js)</li>
<li>Load script files from assembly resources</li>
<li>Specify if debug or release scripts should be used, or use the debug setting from the web.config file</li>
<li>Ability to set any of the options provided by LABjs</li>
<li>Include wait() calls in the chain, and provide inline functions to be executed after the wait</li>
<li>Use LabScriptManagerProxy to add scripts and waits to the chain in content pages and user controls</li>
<li>Use LabActionGroup inside LabScriptManagerProxy to add script() calls at a specific point in the primary chain</li>
<li>LABjs debug and release versions are embedded in the DLL and automatically referenced, but you can opti0nally override this with your own URL</li>
<li>Experimental support for the cdnLABjs library I am working on, which provides automatic failover to a local file if a file fails to load from a CDN (for information about why, see <a href="http://bit.ly/8YKQ2f">Using CDN Hosted jQuery with a Local Fall-back Copy</a>)</li>
</ol>
<p>Below you will find links to the current release candidate, 1.0rc1.  Please review it and give me any feedback you might have.</p>
<p><a href="http://cloud.github.com/downloads/btburnett3/LABjs.Net/LABjs.Net-1.0rc3.zip">Download Binaries</a><br />
<a href="http://github.com/btburnett3/LABjs.Net/raw/master/README">Readme File</a><br />
<a href="http://github.com/btburnett3/LABjs.Net">Git Repository</a></p>
<p><strong>Update 2/8/2010:</strong> <a href="http://btburnett.com/2010/02/labjs-net-release-candidate-1-0rc4.html">Updated to version 1.0rc4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2010/01/simplify-asynchronous-javascript-loading-in-asp-net.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery.Net</title>
		<link>http://btburnett.com/2009/05/jquerynet.html</link>
		<comments>http://btburnett.com/2009/05/jquerynet.html#comments</comments>
		<pubDate>Sat, 02 May 2009 14:49:25 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://btburnett.com/?p=68</guid>
		<description><![CDATA[In the last few months, I&#8217;ve discovered jQuery and jQuery UI, which are a pair pretty awesome of open source javascript libraries.  I know, I&#8217;m a little behind the times here, but all I can say is &#8220;Wow&#8221;.  Frankly, using jQuery makes the AJAX library that comes with .NET 3.0/3.5 from Microsoft seem foolish and [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few months, I&#8217;ve discovered<a href="http://jquery.com"> jQuery</a> and <a href="http://ui.jquery.com">jQuery UI</a>, which are a pair pretty awesome of open source javascript libraries.  I know, I&#8217;m a little behind the times here, but all I can say is &#8220;Wow&#8221;.  Frankly, using jQuery makes the AJAX library that comes with .NET 3.0/3.5 from Microsoft seem foolish and clunky.  I&#8217;ve now transitioned away from using Microsoft&#8217;s open source AJAX Control Library, instead choosing to use jQuery.</p>
<p>The only downside of using jQuery with ASP.Net is the lack of integration.  They now include a vsdoc file which helps with Intellisense, but there&#8217;s a long way to go.  For simplicity, I&#8217;m still using Microsoft&#8217;s AJAX code for their page methods and UpdatePanels, and primarily using jQuery for the client side controls and animations.</p>
<p>I&#8217;ve written a library to help with the creation of ASP.Net server controls that utilize jQuery.  I&#8217;m calling it, very creatively, jQuery.Net.  You can access the code and binaries for the library on github, the link&#8217;s below.</p>
<p><a href="http://github.com/btburnett3/jquery.net/tree/master" target="_blank">jQuery.Net Git Repository</a></p>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2009/05/jquerynet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Appending Text To The Titles Of All Web Pages</title>
		<link>http://btburnett.com/2008/08/appending-text-to-the-titles-of-all-web-pages.html</link>
		<comments>http://btburnett.com/2008/08/appending-text-to-the-titles-of-all-web-pages.html#comments</comments>
		<pubDate>Sun, 31 Aug 2008 16:35:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=21</guid>
		<description><![CDATA[Have you ever wanted to add a text string, like an application name, to the title of all your web pages. It&#8217;s easy to do using the control adapters available in ASP.NET 2.0 and later. First, create a new .browser file in the App_Browsers folder of your application, or add this entry to an existing [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:85%;">Have you ever wanted to add a text string, like an application name, to the title of all your web pages.  It&#8217;s easy to do using the control adapters available in ASP.NET 2.0 and later.  First, create a new .browser file in the App_Browsers folder of your application, or add this entry to an existing file.  Be sure to substitute MyNamespace for the correct namespace where the class is located.</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">browsers</span><span class="kwrd">&gt;</span>

  <span class="kwrd">&lt;</span><span class="html">browser</span> <span class="attr">refID</span><span class="kwrd">="Default"</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">controlAdapters</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">adapter</span> <span class="attr">controlType</span><span class="kwrd">="System.Web.UI.HtmlControls.HtmlHead"</span>
               <span class="attr">adapterType</span><span class="kwrd">="MyNamespace.TitleAdapter"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">controlAdapters</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">browser</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;/</span><span class="html">browsers</span><span class="kwrd">&gt;</span></pre>
<p>Now create the TitleAdapter class that is referenced by the .browser file:</p>
<pre class="csharpcode"><span class="kwrd">Imports</span> System.Web.UI.Adapters

<span class="kwrd">Public</span> <span class="kwrd">Class</span> TitleAdapter
    <span class="kwrd">Inherits</span> ControlAdapter

    <span class="kwrd">Private</span> <span class="kwrd">Shared</span> _titleAppendString <span class="kwrd">As</span> <span class="kwrd">String</span> = <span class="str">" - Your Application Name Here"</span>
    <span class="kwrd">Public</span> <span class="kwrd">Shared</span> <span class="kwrd">Property</span> TitleAppendString() <span class="kwrd">As</span> <span class="kwrd">String</span>
        <span class="kwrd">Get</span>
            <span class="kwrd">Return</span> _titleAppendString
        <span class="kwrd">End</span> <span class="kwrd">Get</span>
        <span class="kwrd">Set</span>(<span class="kwrd">ByVal</span> value <span class="kwrd">As</span> <span class="kwrd">String</span>)
            _titleAppendString = value
        <span class="kwrd">End</span> <span class="kwrd">Set</span>
    <span class="kwrd">End</span> <span class="kwrd">Property</span>

    <span class="kwrd">Protected</span> <span class="kwrd">Overrides</span> <span class="kwrd">Sub</span> Render(<span class="kwrd">ByVal</span> writer <span class="kwrd">As</span> System.Web.UI.HtmlTextWriter)
        <span class="kwrd">MyBase</span>.Render(<span class="kwrd">New</span> TitleAdapterHtmlTextWriter(writer, TitleAppendString))
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

<span class="kwrd">End</span> <span class="kwrd">Class</span></pre>
<p>And finally, create the HtmlTextWriter that is referenced by the control adapter:</p>
<pre class="csharpcode"><span class="kwrd">Public</span> <span class="kwrd">Class</span> TitleAdapterHtmlTextWriter
    <span class="kwrd">Inherits</span> HtmlTextWriter

    <span class="kwrd">Public</span> <span class="kwrd">Sub</span> <span class="kwrd">New</span>(<span class="kwrd">ByVal</span> writer <span class="kwrd">As</span> HtmlTextWriter, <span class="kwrd">ByVal</span> appendString <span class="kwrd">As</span> <span class="kwrd">String</span>)
        <span class="kwrd">MyBase</span>.<span class="kwrd">New</span>(writer)
        InnerWriter = writer.InnerWriter

        _appendString = appendString
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

    <span class="kwrd">Public</span> <span class="kwrd">Sub</span> <span class="kwrd">New</span>(<span class="kwrd">ByVal</span> writer <span class="kwrd">As</span> System.IO.TextWriter, <span class="kwrd">ByVal</span> appendString <span class="kwrd">As</span> <span class="kwrd">String</span>)
        <span class="kwrd">MyBase</span>.<span class="kwrd">New</span>(writer)
        InnerWriter = writer

        _appendString = appendString
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

    <span class="kwrd">Private</span> _appendString <span class="kwrd">As</span> <span class="kwrd">String</span>

    <span class="kwrd">Private</span> _renderingTitle <span class="kwrd">As</span> <span class="kwrd">Boolean</span> = <span class="kwrd">False</span>
    <span class="kwrd">Private</span> _nestedCount <span class="kwrd">As</span> <span class="kwrd">Integer</span>

    <span class="kwrd">Public</span> <span class="kwrd">Overrides</span> <span class="kwrd">Sub</span> RenderBeginTag(<span class="kwrd">ByVal</span> tagName <span class="kwrd">As</span> <span class="kwrd">String</span>)
        <span class="kwrd">If</span> _renderingTitle <span class="kwrd">Then</span>
            _nestedCount += 1
        <span class="kwrd">ElseIf</span> <span class="kwrd">String</span>.Equals(tagName, <span class="str">"title"</span>, StringComparison.InvariantCultureIgnoreCase) <span class="kwrd">Then</span>
            _renderingTitle = <span class="kwrd">True</span>
            _nestedCount = 0
        <span class="kwrd">End</span> <span class="kwrd">If</span>

        <span class="kwrd">MyBase</span>.RenderBeginTag(tagName)
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

    <span class="kwrd">Public</span> <span class="kwrd">Overrides</span> <span class="kwrd">Sub</span> RenderBeginTag(<span class="kwrd">ByVal</span> tagKey <span class="kwrd">As</span> System.Web.UI.HtmlTextWriterTag)
        <span class="kwrd">If</span> _renderingTitle <span class="kwrd">Then</span>
            _nestedCount += 1
        <span class="kwrd">ElseIf</span> tagKey = HtmlTextWriterTag.Title <span class="kwrd">Then</span>
            _renderingTitle = <span class="kwrd">True</span>
            _nestedCount = 0
        <span class="kwrd">End</span> <span class="kwrd">If</span>

        <span class="kwrd">MyBase</span>.RenderBeginTag(tagKey)
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

    <span class="kwrd">Public</span> <span class="kwrd">Overrides</span> <span class="kwrd">Sub</span> RenderEndTag()
        <span class="kwrd">If</span> _renderingTitle <span class="kwrd">Then</span>
            <span class="kwrd">If</span> _nestedCount &gt; 0 <span class="kwrd">Then</span>
                _nestedCount -= 1
            <span class="kwrd">Else</span>
                _renderingTitle = <span class="kwrd">False</span>
                Write(_appendString)
            <span class="kwrd">End</span> <span class="kwrd">If</span>
        <span class="kwrd">End</span> <span class="kwrd">If</span>

        <span class="kwrd">MyBase</span>.RenderEndTag()
    <span class="kwrd">End</span> <span class="kwrd">Sub</span>

<span class="kwrd">End</span> <span class="kwrd">Class</span></pre>
<p>Note that you can edit the text string in the TitleAdapter class.  Additionally, it is a static variable so you can alter it at startup from a database column in your Global.asax file.</p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/08/appending-text-to-the-titles-of-all-web-pages.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application To Generate ASP.NET Machine Keys</title>
		<link>http://btburnett.com/2008/08/application-to-generate-aspnet-machine-keys.html</link>
		<comments>http://btburnett.com/2008/08/application-to-generate-aspnet-machine-keys.html#comments</comments>
		<pubDate>Tue, 26 Aug 2008 16:25:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=20</guid>
		<description><![CDATA[Frankly, it&#8217;s always a pain to create ASP.NET machine keys for each of your web applications. I&#8217;ve written a little helper app that creates the &#60;machineKey&#62; section for your web.config file for you, with options for various encryption and validation algorithms. Special thanks go to Ben Strackany, who&#8217;s article ASP.NET: MachineKey Generator I used as [...]]]></description>
			<content:encoded><![CDATA[<div><small>Frankly, it&#8217;s always a pain to create ASP.NET machine keys for each of your web applications.  I&#8217;ve written a little helper app that creates the &lt;machineKey&gt; section for your web.config file for you, with options for various encryption and validation algorithms.</p>
<p>Special thanks go to Ben Strackany, who&#8217;s article <a href="http://archive.devwebpro.com/devwebpro-39-20061228ASPNETmachineKeyGenerator.html">ASP.NET: MachineKey Generator</a> I used as my starting point.<br />
<big><br />
<a href="http://btburnett.com/downloads/MKGen.1.0.0.0.zip">Download MKGen 1.0.0.0</a></big></small></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/08/application-to-generate-aspnet-machine-keys.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update To Partial Authentication System</title>
		<link>http://btburnett.com/2008/08/update-to-partial-authentication-system-2.html</link>
		<comments>http://btburnett.com/2008/08/update-to-partial-authentication-system-2.html#comments</comments>
		<pubDate>Tue, 26 Aug 2008 16:01:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=19</guid>
		<description><![CDATA[I&#8217;ve posted an update to the Partial Authentication System that fixes the following minor bugs: Fixed bug where PartialAuthentication properties weren&#8217;t always initialized after application reload Fixed bug where invalid authentication tickets were raising exception instead of ignoring them You can download the new source code and binaries here: Partial Authentication System 1.0.1.1 Source and [...]]]></description>
			<content:encoded><![CDATA[<div><small>I&#8217;ve posted an update to the Partial Authentication System that fixes the following minor bugs:<br />
</small></p>
<ul>
<li><small>Fixed bug where PartialAuthentication properties weren&#8217;t always initialized after application reload</small></li>
<li><small>Fixed bug where invalid authentication tickets were raising exception instead of ignoring them</small></li>
</ul>
<p><small>You can download the new source code and binaries here:</p>
<p><big><a href="http://btburnett.com/downloads/PartialAuthenticationSystem.1.0.1.1.zip">Partial Authentication System 1.0.1.1 Source and Binary</a></big><br />
</small></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/08/update-to-partial-authentication-system-2.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Easily Work With Differing Time Zones In An ASP.NET 3.5 Application</title>
		<link>http://btburnett.com/2008/06/easily-work-with-differing-time-zones-in-an-aspnet-35-application.html</link>
		<comments>http://btburnett.com/2008/06/easily-work-with-differing-time-zones-in-an-aspnet-35-application.html#comments</comments>
		<pubDate>Wed, 18 Jun 2008 09:36:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=16</guid>
		<description><![CDATA[When working with ASP.NET applications, time zones are often a problem when dealing with DateTime structures. There are two different common scenarios that a developer is likely to encounter. The first is that you are placing the application on a hosted server that is in a different time zone than the business you are trying [...]]]></description>
			<content:encoded><![CDATA[<div><small>When working with ASP.NET applications, time zones are often a problem when dealing with<br />
DateTime structures.  There are two different common scenarios that a developer is likely<br />
to encounter.  The first is that you are placing the application on a hosted server<br />
that is in a different time zone than the business you are trying to operate.  The second<br />
is that you have users from different time zones and would like to display the date and time<br />
to the user in their local time zone rather than the server&#8217;s time zone.</p>
<p>Hosted Time Zone addresses this problem by providing two settings.  ApplicationTimeZone sets<br />
the time zone to be used by the entire application.  ThreadTimeZone sets the time zone to be<br />
used by the currently running thread, which defaults to the ApplicationTimeZone if no time<br />
zone has been specified on the thread.  If you are using ThreadTimeZone then you need to be<br />
sure to set the value for each request made to the server.  You will usually do this in your<br />
global.asax file, such as in the Application_BeginRequest handler.</p>
<p>To actually perform the conversions you can call the ToAppTime, FromAppTime, ToThreadTime, or<br />
FromThreadTime static methods on the ApplicationTimeZone class.  Additionally, extension methods<br />
have been declared for the DateTime and DateTimeOffset classes that perform the same functions<br />
more cleanly.  In order for the extension methods to work you must import the HostedTimeZone<br />
namespace.</p>
<p>You should note that there are not any overloads for FromAppTime or FromThreadTime for the<br />
DateTimeOffset class.  This is because the ToLocalTime method of DateTimeOffset performs the<br />
same function, so they would be redundant.</p>
<p>This library requires the TimeZoneInfo class, which is not available until the .NET Framework 3.5.<br />
Therefore, it is not compatible with ASP.NET 2.0 or earlier.</p>
<p><big><a href="http://btburnett.com/downloads/HostedTimeZone.1.0.0.0.zip">Hosted Time Zone 1.0.0.0</a></big><br />
</small></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/06/easily-work-with-differing-time-zones-in-an-aspnet-35-application.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using URL Rewriting With Web Parts</title>
		<link>http://btburnett.com/2008/06/using-url-rewriting-with-web-parts.html</link>
		<comments>http://btburnett.com/2008/06/using-url-rewriting-with-web-parts.html#comments</comments>
		<pubDate>Tue, 10 Jun 2008 16:00:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[URL rewriting]]></category>
		<category><![CDATA[Web Parts]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=15</guid>
		<description><![CDATA[Web parts are a great new system for allowing personalization of web sites by end users that was introduced in ASP.NET 2.0. However, it isn&#8217;t useful when used in combination with URL rewriting. URL rewriting allows you to respond to requests from dynamic URLs by redirecting the handling to a different .ASPX file on your [...]]]></description>
			<content:encoded><![CDATA[<div><small>Web parts are a great new system for allowing personalization of web sites by end users that<br />
was introduced in ASP.NET 2.0.  However, it isn&#8217;t useful when used in combination with<br />
URL rewriting.</p>
<p>URL rewriting allows you to respond to requests from dynamic URLs by redirecting the handling<br />
to a different .ASPX file on your server.  This can be used to make your URLs more readable<br />
and improve your search engine optimization (SEO), instead of using long query parameters.<br />
Some example systems for implementing this are UrlRewriter.net and UrlRewriting.net.</p>
<p>When you use web parts in combination with a rewritten URL, the web parts will all be shared by<br />
all of the URLs that are rewritten to the same .ASPX file.  This library corrects this<br />
by replacing the WebPartManager with RewritableWebPartManager and the SqlPersonalizationProvider<br />
with RewritableSqlPersonalizationProvider.</p>
<p>It also provides additional functionality in the form a personalization levels.  This allows you<br />
to share common personalization settings amonst multiple URLs.  When a user is browsing, if no<br />
personalization is specified at a particular level, the personalization defined at a higher level<br />
is displayed instead.  For example, in a web store scenario you can allow the store operators to<br />
provide shared personalization that all users will see.  Using levels, they can set personalization<br />
that will appear on all item pages, such as a disclaimer, and then override that personalization<br />
with a different disclaimer on a specific item&#8217;s page.</p>
<p>More information can be found in the readme file included in the download.</p>
<p><big><a href="http://btburnett.com/downloads/RewritableWebPartsLibrary.1.0.0.0.zip">Rewritable Web Parts Library 1.0.0.0</a></big><br />
</small></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/06/using-url-rewriting-with-web-parts.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Update To Partial Authentication System</title>
		<link>http://btburnett.com/2008/05/update-to-partial-authentication-system.html</link>
		<comments>http://btburnett.com/2008/05/update-to-partial-authentication-system.html#comments</comments>
		<pubDate>Wed, 28 May 2008 17:39:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=13</guid>
		<description><![CDATA[I&#8217;ve posted an improvement to the Partial Authentication System originally posted at Secure Persistent ASP.NET Forms Authentication. I discovered a problem in the automatic redirection of requests back to HTTP from HTTPS using the requiresSSL=&#8221;None&#8221; setting in the authorization section. Since most sites would set this to none for their root folder, this caused a [...]]]></description>
			<content:encoded><![CDATA[<p><small>I&#8217;ve posted an improvement to the Partial Authentication System originally posted at <a href="http://blog.btburnett.com/2008/05/secure-persistent-aspnet-forms.html">Secure Persistent ASP.NET Forms Authentication</a>.</small></p>
<p><small>I discovered a problem in the automatic redirection of requests back to HTTP from HTTPS using the requiresSSL=&#8221;None&#8221; setting in the authorization section.  Since most sites would set this to none for their root folder, this caused a problem with the links generated by ASP.NET and AJAX to WebResource.axd and ScriptResource.axd, which are logically (not physically) located in the root of the web application.  If you have a secure page in another folder which requests these resources, they were being redirected back to an insecure connection, causing a potential security flaw and causing Firefox to display warnings about partial security.</small></p>
<p><small>This has been addressed by ignoring the requiresSSL=&#8221;None&#8221; setting for a request for any file with the &#8220;.axd&#8221; extension, effectively treating it as requiresSSL=&#8221;Optional&#8221; instead.  Note that requiresSSL=&#8221;Required&#8221; is still enforced as normal for files with this extension.</small></p>
<p><small>I&#8217;ve posted new source and binaries for download.<br />
<span style="font-size:130%;"><br />
<strong>UPDATE: Please see updated version <a href="http://btburnett.com/2008/08/update-to-partial-authentication-system-2.html">here</a></strong><br />
</span></small></p>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/05/update-to-partial-authentication-system.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Persistent ASP.NET Forms Authentication</title>
		<link>http://btburnett.com/2008/05/secure-persistent-aspnet-forms-authentication.html</link>
		<comments>http://btburnett.com/2008/05/secure-persistent-aspnet-forms-authentication.html#comments</comments>
		<pubDate>Tue, 13 May 2008 14:08:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=11</guid>
		<description><![CDATA[While the ASP.NET Forms Authentication system is a great system for authentication, it has one significant shortcoming for a lot of sites. You can either only restrict it to always pass the authentication cookies in a secure manner or always pass them even if the connection is not secure. There is no intermediate method of [...]]]></description>
			<content:encoded><![CDATA[<div><small>While the ASP.NET Forms Authentication system is a great system for authentication, it has one significant shortcoming for a lot of sites. You can either only restrict it to always pass the authentication cookies in a secure manner or always pass them even if the connection is not secure. There is no intermediate method of authentication available to you. This means that if you are operating a web store you have a problem.</small></p>
<p><small>Normally, a web store wants the customer identified as soon as they come to the site, and throughout the shopping experience. However, when the user goes to edit their account or checkout, you want to switch them to a secure mode. In order to be secure, the cookie used to authenticate them for checkout must be restricted to SSL connections. This means that to maintain their login, you would have to remain in SSL from the moment they sign in forward, which adds a lot of unnecessary server load. Plus, it can cause headaches with external content you might want to include on your page that isn&#8217;t encrypted.</small></p>
<p><small>The solution is to modify the forms authentication system to use a pair of cookies. One is valid only to identify you but not access secure functions, doesn&#8217;t require SSL to be transmitted, and is persistent across sessions. The other is a full authentication and requires SSL to be transmitted.</small></p>
<p><small>The basic method this system uses is adding two additional HttpModules to your web.config file, PartialAuthenticationModule and PartialAuthorizationModule.</small></p>
<p><small>The PartialAuthenticationModule works by adding to the existing FormsAuthenticationModule.  The FormsAuthenticationModule is used as normal to process authentication for the secure authentication cookie (requireSSL should be set to true for the forms module in web.config).  The PartialAuthenticationModule kicks in after the FormsAuthenticationModule.  If there is no user on the current request (i.e. not a secure request, so client didn&#8217;t transmit the cookie) then the user is added to the context from the secondary insecure cookie instead.  The user that is added will have the &#8220;Partial&#8221; AuthenticationType instead of &#8220;Forms&#8221;.  In case the login has changed, it will also clear the old secondary cookie if the username doesn&#8217;t match with the secure cookie.</small></p>
<p><small>The PartialAuthorizationModule processes later in the request life cycle.  It uses the  section of the  section of your web.config files to identify security requirements on each folder.  You just add a web.config file to each subfolder as required.  This section supports two key fields.  requiresLogin is either true or false, and specifies if the folder requires a secure login using the primary FormsAuthentication cookie.  It verifies this by checking the AuthenticationType on the logged in user.  The second field is requireSSL, which can be None, Optional, or Required.  This will automatically redirect the request to or from https based on how you want the folder to be handled.  This allows you to use normal app-relative URLs throughout your application without worrying about switching to and from https.  Normally, for most folders you would use requiresLogin=&#8221;false&#8221; and requireSSL=&#8221;None&#8221;, and for secure folders you would use requiresLogin=&#8221;true&#8221; and requireSSL=&#8221;Required&#8221;.</small></p>
<p><small>I&#8217;ve also implemented a PartialAuthentication static class that is very similar to the FormsAuthentication static class.  It actually uses a lot of the methods from the FormsAuthentication class to help it with a lot of the processing.  In particular, you should switch any login or logoff code to use the methods in the PartialAuthentication class instead of FormsAuthentication.  This will create or remove both of the necessary cookies.  To sign off a user from the secure section but still leave the persistent insecure cookie, use the FormsAuthentication.SignOff method instead.</small></p>
<p><small>As far as security is concerned, the partial authentication cookie is generated using a FormsAuthenticationTicket just like with FormsAuthentication.  It only difference is that the name of the cookie is prepended to the username in the ticket, and on decryption that string is validated.  This prevents a client from editing their cookie file to set the secure cookie to have the same value as the insecure cookie.  The cookies are encrypted using the same machine authentication keys as the forms authentication tickets, so they should work on web farms in the same manner.</small></p>
<p><small>Please note that this library is designed for .NET 3.5 and Visual Studio 2008, though it should be easily<br />
convertible back to .NET 2.0 if you change the project settings.</small></div>
<div><strong>UPDATE: Please see updated version <a href="http://btburnett.com/2008/08/update-to-partial-authentication-system-2.html">here</a></strong></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/05/secure-persistent-aspnet-forms-authentication.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fix To GroupedUpdatePanel</title>
		<link>http://btburnett.com/2008/04/fix-to-groupedupdatepanel.html</link>
		<comments>http://btburnett.com/2008/04/fix-to-groupedupdatepanel.html#comments</comments>
		<pubDate>Mon, 28 Apr 2008 14:59:00 +0000</pubDate>
		<dc:creator>Brant Burnett</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.btburnett.com/?p=9</guid>
		<description><![CDATA[After further testing, I discovered a bug in my GroupedUpdatePanel. It didn&#8217;t always function correctly when the postback was initiated by a child control with ChildrenAsTriggers set to true. Any UpdatePanels declared after the initiated panel would update, but those before would not. I&#8217;ve corrected this, though it&#8217;s now a bit more complicated. There is [...]]]></description>
			<content:encoded><![CDATA[<div><small>After further testing, I discovered a bug in my GroupedUpdatePanel.  It didn&#8217;t always function correctly when the postback was initiated by a child control with ChildrenAsTriggers set to true.  Any UpdatePanels declared after the initiated panel would update, but those before would not.  I&#8217;ve corrected this, though it&#8217;s now a bit more complicated.  There is an processing module which needs to be added to your web.config file in the  section.  Here&#8217;s the link to the corrected file.</small></p>
<p><small><a href="http://btburnett.com/downloads/GroupedUpdatePanel.zip">GroupedUpdatePanel.zip</a><br />
</small></div>
]]></content:encoded>
			<wfw:commentRss>http://btburnett.com/2008/04/fix-to-groupedupdatepanel.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
