<?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>David Radcliffe &#187; .NET</title>
	<atom:link href="http://www.dwradcliffe.com/blog/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwradcliffe.com</link>
	<description>Web Developer</description>
	<lastBuildDate>Fri, 03 Sep 2010 00:37:53 +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>Windows Authentication in Firefox</title>
		<link>http://www.dwradcliffe.com/blog/2010/04/windows-authentication-in-firefox/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/04/windows-authentication-in-firefox/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 02:29:25 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=243</guid>
		<description><![CDATA[Many .NET based web apps and enterprise web apps use Windows authentication so you don&#8217;t have to ever login &#8211; your browser automatically uses your windows credentials. For a long time I assumed this only worked in Internet Explorer but I recently found that Firefox will do this too! All you need to do is tell it [...]]]></description>
			<content:encoded><![CDATA[<p>Many .NET based web apps and enterprise web apps use Windows authentication so you don&#8217;t have to ever login &#8211; your browser automatically uses your windows credentials. For a long time I assumed this only worked in Internet Explorer but I recently found that Firefox will do this too! All you need to do is tell it which websites are allowed to use the windows credentials and you all set. Here are the steps:</p>
<ol>
<li>Visit <a href="about:config">about:config</a> in Firefox.</li>
<li>You might need to click the &#8220;I&#8217;ll be careful, I promise!&#8221; button to continue.</li>
<li>Use the filter at the top to find the following three properties (one at a time)
<ul>
<li>network.negotiate-auth.trusted-uris</li>
<li>network.negotiate-auth.delegation-uris</li>
<li>network.automatic-ntlm-auth.trusted-uris</li>
</ul>
</li>
<li>Double click the property and add the URL of the site you are trying to use Windows authentication with to the value. If you have several sites, separate them with commas.</li>
</ol>
<p>Thats it!</p>
<p><span style="color: #888888;">You should <a href="http://www.twitter.com/dwradcliffe"">follow me on twitter</a> @dwradcliffe.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/04/windows-authentication-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UpdateModel requires properties</title>
		<link>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 01:32:40 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=225</guid>
		<description><![CDATA[I was working on a feature at work this week on a ASP MVC project. I was attempting to use UpdateModel to update an object retrieved from the database with values from the POST. If you aren&#8217;t familiar with it, ASP MVC has a &#8220;magic method&#8221; to map these POST values to an object. One [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a feature at work this week on a ASP MVC project. I was attempting to use UpdateModel to update an object retrieved from the database with values from the POST. If you aren&#8217;t familiar with it, ASP MVC has a &#8220;magic method&#8221; to map these POST values to an object. One simply needs to call</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">UpdateModel<span style="color: #000000;">&#40;</span>myObjectFromDatabase<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p> and the new values will be changed on the object.</p>
<p>That is all fine and dandy unless it doesn&#8217;t work. I had checked everything. I could verify that the values were in the Request header. I could verify that UpdateModel was called and did not fail. The values simply were not updated.</p>
<p>I finally found the key (thanks to my supervisor). The object I was updating had a mix of auto-properties and fields. Apparently, UpdateModel will only update properties. A quick change from a field to an auto-property and everything worked as it should. Thanks Aaron!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/02/updatemodel-requires-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Phone Numbers</title>
		<link>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/</link>
		<comments>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 20:34:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.dwradcliffe.com/?p=184</guid>
		<description><![CDATA[I&#8217;ve been working with a lot of person type data recently at work and I&#8217;m using data from multiple sources. Not just two databases but two separate systems with similar and yet incompatible data. One of the biggest messes was the phone numbers. I need to convert a phone number from a completely un-normalized format [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a lot of person type data recently at work and I&#8217;m using data from multiple sources. Not just two databases but two separate systems with similar and yet incompatible data. One of the biggest messes was the phone numbers. I need to convert a phone number from a completely un-normalized format to a very strict format. I&#8217;m no regular expression genius so thankfully a quick Google search produced a nice PHP method of doing pretty much exactly what I was looking for. (<a href="http://cnanney.com/journal/code/cleaning-phone-numbers-with-regex/">http://cnanney.com/journal/code/cleaning-phone-numbers-with-regex/</a>) I took that method and re-wrote it in C# and tweaked it a little for my application. I&#8217;m sure this isn&#8217;t the absolute best way to do this but it works for me.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">const</span> <span style="color: #FF0000;">string</span> pattern <span style="color: #008000;">=</span> <span style="color: #666666;">@&quot;\D*\(?(\d{3})?\)?\D*(\d{3})\D*(\d{4})\D*(\d{1,8})?&quot;</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">string</span> num, ext<span style="color: #008000;">;</span>
var matches <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #000000;">&#40;</span>pattern<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Match</span><span style="color: #000000;">&#40;</span>number<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Groups</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;(&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;) &quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;-&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;-&quot;</span> <span style="color: #008000;">+</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">3</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
ext <span style="color: #008000;">=</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">?</span> matches<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">4</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">:</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
num <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
ext <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.dwradcliffe.com/blog/2010/02/clean-phone-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->