<?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>Didsbury Design Blog &#187; Development</title>
	<atom:link href="http://blog.didsburydesign.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.didsburydesign.com</link>
	<description>Web Design and Development</description>
	<lastBuildDate>Wed, 27 Feb 2013 22:28:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Certified Specialist: Programming in HTML5 with JavaScript and CSS3</title>
		<link>http://blog.didsburydesign.com/2013/01/programming-in-html5-with-javascript-and-css3/</link>
		<comments>http://blog.didsburydesign.com/2013/01/programming-in-html5-with-javascript-and-css3/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 23:59:52 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Company News]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=400</guid>
		<description><![CDATA[Andrew, the founder of Didsbury Design has now successfully achieved the Microsoft Certified specialist certification for: Programming in HTML5 with JavaScript and CSS3. This is just part of our goal to provide better solutions for Business’ looking to harness the value that HTML5, CSS3 and Ajax can provide.
Please don’t hesitate to get in touch if [...]]]></description>
			<content:encoded><![CDATA[<p>Andrew, the founder of Didsbury Design has now successfully achieved the Microsoft Certified specialist certification for: <em>Programming in HTML5 with JavaScript and CSS3</em>. This is just part of our goal to provide better solutions for Business’ looking to harness the value that HTML5, CSS3 and Ajax can provide.</p>
<p>Please don’t hesitate to get in touch if you have any projects you wish to discuss, we would be happy to assist.</p>
<p><img src="http://www.didsburydesign.com/Assets/Images/Awards/HTML5-Exam-Logo.png" alt="Programming in HTML5 with JavaScript and CSS3" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2013/01/programming-in-html5-with-javascript-and-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Certified Professional Developer: SharePoint 2010</title>
		<link>http://blog.didsburydesign.com/2013/01/microsoft-certified-professional-developer-sharepoint-2010/</link>
		<comments>http://blog.didsburydesign.com/2013/01/microsoft-certified-professional-developer-sharepoint-2010/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 23:53:50 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Award]]></category>
		<category><![CDATA[Certified]]></category>
		<category><![CDATA[MCPD]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=388</guid>
		<description><![CDATA[Andrew, the founder of Didsbury Design has now successfully achieved the Microsoft Certified Professional Developer: SharePoint 2010. This is just part of our goal to provide better solutions for Business’ looking to harness the value that SharePoint can provide when configured, and customised effectively. 
Please don’t hesitate to get in touch if you have any [...]]]></description>
			<content:encoded><![CDATA[<p>Andrew, the founder of Didsbury Design has now successfully achieved the Microsoft Certified Professional Developer: SharePoint 2010. This is just part of our goal to provide better solutions for Business’ looking to harness the value that SharePoint can provide when configured, and customised effectively. </p>
<p>Please don’t hesitate to get in touch if you have any SharePoint or Dynamics CRM projects you wish to discuss, we would be happy to assist.</p>
<p><img alt="Microsoft Certified Professional Developer" src="http://www.didsburydesign.com/Assets/Images/Awards/MCPD-SP2010.jpg" width="301" height="80" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2013/01/microsoft-certified-professional-developer-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umbraco Certified Developer &#8211; Level 2</title>
		<link>http://blog.didsburydesign.com/2013/01/umbraco-certified-developer-level-2/</link>
		<comments>http://blog.didsburydesign.com/2013/01/umbraco-certified-developer-level-2/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 23:37:19 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[Company News]]></category>
		<category><![CDATA[Umbraco CMS]]></category>
		<category><![CDATA[Award]]></category>
		<category><![CDATA[Certified]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=379</guid>
		<description><![CDATA[Andrew, the founder of Didsbury Design has now successfully achieved the Umbraco Certified Developer award at level 2. This is just part of our journey to being able to better provide solutions for business&#8217; looking for a professional Content Management System.
Please don&#8217;t hesitate to get in touch if you have any projects coming up you [...]]]></description>
			<content:encoded><![CDATA[<p>Andrew, the founder of Didsbury Design has now successfully achieved the Umbraco Certified Developer award at level 2. This is just part of our journey to being able to better provide solutions for business&#8217; looking for a professional Content Management System.</p>
<p>Please don&#8217;t hesitate to get in touch if you have any projects coming up you wish to discuss.</p>
<p><img title="Umbraco Certified Developer - Level 2" src="http://www.didsburydesign.com/Assets/Images/Awards/white.png" alt="Umbraco Certified Developer - Level 2" width="200" height="61" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2013/01/umbraco-certified-developer-level-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umbraco CMS Redirecting to the Installation Screen after content is published</title>
		<link>http://blog.didsburydesign.com/2012/09/umbraco-4-keeps-redirecting-to-installation-screen-after-content-published/</link>
		<comments>http://blog.didsburydesign.com/2012/09/umbraco-4-keeps-redirecting-to-installation-screen-after-content-published/#comments</comments>
		<pubDate>Sat, 29 Sep 2012 13:34:16 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Umbraco CMS]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Umbraco]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=351</guid>
		<description><![CDATA[So you have decided to go with Umbraco as your CMS (good choice).
After you have installed Umbraco and created a published page via the administration area you should be able to view your site. If you can view the site, this post is not for you!
If you are getting redirected to the installation page even [...]]]></description>
			<content:encoded><![CDATA[<p>So you have decided to go with <a title="Umbraco - Open Source CMS" href="http://umbraco.org/" target="_blank">Umbraco </a>as your CMS (good choice).</p>
<p>After you have installed Umbraco and created a published page via the administration area you should be able to view your site. If you can view the site, this post is not for you!</p>
<p>If you are getting redirected to the installation page even though you have published content then please check that in the web.config you have the following value set to your version of Umbraco:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;add key=&quot;umbracoConfigurationStatus&quot; value=&quot;4.9.0&quot; /&gt;</pre></div></div>

<p>Sometimes if the permissions were not correct for the web.config file during install you will find the connection string you used upon installation is not persisted and also this version number is not set.</p>
<p>Once you set this value you should be able to view your content.</p>
<p>Hopefully this will save you some time if your having this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2012/09/umbraco-4-keeps-redirecting-to-installation-screen-after-content-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolve Multiple Default Views in Microsoft Dynamics CRM 2011 (Supported)</title>
		<link>http://blog.didsburydesign.com/2012/04/resolve-multiple-default-views-in-microsoft-dynamics-crm-2011-supported/</link>
		<comments>http://blog.didsburydesign.com/2012/04/resolve-multiple-default-views-in-microsoft-dynamics-crm-2011-supported/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 19:56:24 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Microsoft Dynamics]]></category>
		<category><![CDATA[Dynamics CRM 2011]]></category>
		<category><![CDATA[Dynamics CRM 4]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Supported]]></category>
		<category><![CDATA[Views]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=329</guid>
		<description><![CDATA[Every now and then, with Dynamics CRM 2011 (and CRM 4), you can end up with two default views for the same Entity. It seems to occur when you import a solution with certain customizations to an entity.
I think in our case it occurred when we renamed the Account entity to be Organisation. A supported way of [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then, with Dynamics CRM 2011 (and CRM 4), you can end up with two default views for the same Entity. It seems to occur when you import a solution with certain customizations to an entity.</p>
<p>I think in our case it occurred when we renamed the Account entity to be Organisation. A supported way of resolving this is outlined below.</p>
<ol>
<li>Create a new view on the same entity called &#8216;fix&#8217; and assign some filter criteria (it doesn&#8217;t matter what)</li>
<li>Set the new view as the default</li>
<li>Publish your changes</li>
<li>Open the new view, go to more actions and delete it. You can&#8217;t delete it from the main list of views as you will get an error &#8220;You cannot delete a default view until you have specified another view as the default&#8221;</li>
<li>Publish your entity again</li>
</ol>
<p>You should now only have one default view and no more problems!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2012/04/resolve-multiple-default-views-in-microsoft-dynamics-crm-2011-supported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matching a W3wp Process to an Application Pool / IIS Site</title>
		<link>http://blog.didsburydesign.com/2011/11/matching-a-w3wp-process-to-an-application-pool-iis-site/</link>
		<comments>http://blog.didsburydesign.com/2011/11/matching-a-w3wp-process-to-an-application-pool-iis-site/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 16:37:21 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[w3p.exe]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=323</guid>
		<description><![CDATA[OK so maybe you are trying to:

Debug a website
Debug a web service
Debug another .NET app

 So you go into Visual Studio, Debug menu, Attach to process&#8230;
SO you are looking for the w3p.exe process, but there are loads! 
Here is how to match up which process related to your application pool or IIS site.
Server 2003
Open a [...]]]></description>
			<content:encoded><![CDATA[<p>OK so maybe you are trying to:</p>
<ul>
<li>Debug a website</li>
<li>Debug a web service</li>
<li>Debug another .NET app</li>
</ul>
<p> So you go into Visual Studio, Debug menu, Attach to process&#8230;</p>
<p>SO you are looking for the w3p.exe process, but there are loads! </p>
<p>Here is how to match up which process related to your application pool or IIS site.</p>
<p><strong>Server 2003</strong><br />
Open a command prompt (run as administrator)<br />
C:\Windows\System32\inetsrv>cscript.exe C:\Windows\System32\system32\iisapp.vbs</p>
<p><strong>Server 2008</strong><br />
Open a command prompt (run as administrator)<br />
%windir%\system32\inetsrv\appcmd.exe list wp</p>
<p>If you get an error WAS service not started &#8211; make sure you opened command prompt as an administrator!</p>
<p>Hope this helps someone else quickly attach to the right process.</p>
<p>Alternatively attach to them all if you are lazy <img src='http://blog.didsburydesign.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2011/11/matching-a-w3wp-process-to-an-application-pool-iis-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canonical URLs in your ASP.NET MVC2 / MVC3 Application</title>
		<link>http://blog.didsburydesign.com/2010/11/canonical-urls-in-your-asp-net-mvc2-mvc3-application/</link>
		<comments>http://blog.didsburydesign.com/2010/11/canonical-urls-in-your-asp-net-mvc2-mvc3-application/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 12:43:11 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MVC2]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C-Sharp]]></category>
		<category><![CDATA[canonical]]></category>
		<category><![CDATA[Filter attribute]]></category>
		<category><![CDATA[MVC3]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=276</guid>
		<description><![CDATA[What are canonical links used for
The Canonical link element was introduced in 2009 to help cleanup duplicate pages on search engines.
The html code is shown below and it basically informs search engines of the primary URL for that page. This means any alternative entry points to that page will not be picked up as duplicate [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What are canonical links used for</strong><br />
The Canonical link element was introduced in 2009 to help cleanup duplicate pages on search engines.<br />
The html code is shown below and it basically informs search engines of the primary URL for that page. This means any alternative entry points to that page will not be picked up as duplicate content. This HTML must be specified in the HEAD section of the document.</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;link rel=&quot;canonical&quot; href=&quot;http://example.com/page.html&quot;/&gt;</pre></div></div>

<p>The search engines have also posted about this on a Google <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html">blog post</a> or <a href="http://google.com/support/webmasters/bin/answer.py?answer=139394">help center documentation</a> from Google, <a href="http://ysearchblog.com/2009/02/12/fighting-duplication-adding-more-arrows-to-your-quiver/">Yahoo’s blog post</a>, or <a href="http://blogs.msdn.com/webmaster/archive/2009/02/12/partnering-to-help-solve-duplicate-content-issues.aspx">Microsoft’s blog post</a>.</p>
<p><strong>How to easily use canonical links in MVC2 using Action Filters and Master Pages</strong></p>
<p>Add this to the master page in the head section as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">    <span style="color: #339933;">&lt;%=</span>ViewData<span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;CanonicalURL&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">%&gt;</span>
    <span style="color: #339933;">&lt;!--</span>Your other head info here<span style="color: #339933;">--&gt;</span></pre></div></div>

<p>Create a Filter Attribute (CanonicalURL.cs):</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">public class CanonicalURL <span style="color: #339933;">:</span> ActionFilterAttribute
<span style="color: #009900;">&#123;</span>
    public <span style="color: #993333;">string</span> Url <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> private set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
    public CanonicalURL<span style="color: #009900;">&#40;</span><span style="color: #993333;">string</span> url<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
       Url <span style="color: #339933;">=</span> url<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    public override <span style="color: #993333;">void</span> OnResultExecuting<span style="color: #009900;">&#40;</span>ResultExecutingContext filterContext<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">string</span> fullyQualifiedUrl <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://www.example.com&quot;</span> <span style="color: #339933;">+</span> this.<span style="color: #202020;">Url</span><span style="color: #339933;">;</span>
        filterContext.<span style="color: #202020;">Controller</span>.<span style="color: #202020;">ViewData</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;CanonicalUrl&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> @<span style="color: #ff0000;">&quot;&lt;link rel='canonical' href='&quot;</span> <span style="color: #339933;">+</span> fullyQualifiedUrl <span style="color: #339933;">+</span> <span style="color: #ff0000;">&quot;' /&gt;&quot;</span><span style="color: #339933;">;</span>
        base.<span style="color: #202020;">OnResultExecuting</span><span style="color: #009900;">&#40;</span>filterContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Call this from your actions:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>CanonicalURL<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Contact-Us&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span>
public ActionResult Index<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
      ContactFormViewModel contact <span style="color: #339933;">=</span> new ContactFormViewModel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
      <span style="color: #b1b100;">return</span> View<span style="color: #009900;">&#40;</span>contact<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>For some other interesting articles on Search Engine Related posts check out <a href="http://www.mattcutts.com/blog/canonical-link-tag/" rel="nofollow">Matt Cutts blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2010/11/canonical-urls-in-your-asp-net-mvc2-mvc3-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC 3 Release Candidate is now available</title>
		<link>http://blog.didsburydesign.com/2010/11/asp-net-mvc-3-release-candidate-is-now-available/</link>
		<comments>http://blog.didsburydesign.com/2010/11/asp-net-mvc-3-release-candidate-is-now-available/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 11:23:06 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C-Sharp]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[mvc 3.0 RC]]></category>

		<guid isPermaLink="false">http://blog.didsburydesign.com/?p=266</guid>
		<description><![CDATA[ASP.NET MVC 3 Release Candidate is now available for download. Phil Haack has written an article about it and also mentions the intentions for MVC 4.
Phil Haack&#8217;s blog post: ASP.NET MVC 3 Release Candidate

Direct download: MVC 3 RC Download
]]></description>
			<content:encoded><![CDATA[<p>ASP.NET MVC 3 Release Candidate is now available for download. Phil Haack has written an article about it and also mentions the intentions for MVC 4.</p>
<p>Phil Haack&#8217;s blog post: <a href="http://haacked.com/archive/2010/11/09/asp-net-mvc-3-release-candidate.aspx?utm_source=feedburner&#038;utm_medium=feed&#038;utm_campaign=Feed%3A+haacked+%28you%27ve+been+HAACKED%29">ASP.NET MVC 3 Release Candidate<br />
</a></p>
<p>Direct download: <a href="http://go.microsoft.com/fwlink/?LinkID=191797">MVC 3 RC Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2010/11/asp-net-mvc-3-release-candidate-is-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Create and Delete a cookie in ASP.NET C#</title>
		<link>http://blog.didsburydesign.com/2010/04/how-to-create-and-delete-a-cookie-in-asp-net-c/</link>
		<comments>http://blog.didsburydesign.com/2010/04/how-to-create-and-delete-a-cookie-in-asp-net-c/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 12:27:55 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C-Sharp]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.zero7web.com/?p=232</guid>
		<description><![CDATA[I thought I would do a quick post about Creating and more importantly Deleting cookies in ASP.NET as it&#8217;s not quite as obvious as it may seem with the misleading .Remove() method which doesnt do as you would expect.
I hope this helps someone get started with cookies if your just getting started with the .NET [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would do a quick post about Creating and more importantly Deleting cookies in ASP.NET as it&#8217;s not quite as obvious as it may seem with the misleading .Remove() method which doesnt do as you would expect.</p>
<p>I hope this helps someone get started with cookies if your just getting started with the .NET framework.<br />
</p>
<h2>Creating a cookie</h2>
<p>
This is a basic example of how to create a cookie in ASP.NET C#<br />
 </p>
<pre>//Create a new cookie, passing the name into the constructor
HttpCookie cookie = new HttpCookie("MyCookie");

//Set the cookies value
cookie.Value = "CookieValue";

//Set the cookie to expire in 1 day
cookie.Expires = DateTime.Now.AddDays(1);

//Add the cookie
Response.Cookies.Add(cookie);</pre>
<h2>Deleting a cookie</h2>
<p>
When deleting a cookie all you need to do is amend the HttpCookie object so it has an expiry date in the past, then re-save the cookie to push the new value to the client.<br />
</p>
<pre>// Clear cookie Info
            if(Request.Cookies["MyCookie"]!=null){

                HttpCookie cookie = Request.Cookies["MyCookie"];
                cookie.Expires = DateTime.Now.AddDays(-1);

                Response.Cookies.Add(cookie);
            }</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2010/04/how-to-create-and-delete-a-cookie-in-asp-net-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: Allow hyphens in URL&#8217;s using ASP.NET MVC 2</title>
		<link>http://blog.didsburydesign.com/2010/02/how-to-allow-hyphens-in-urls-using-asp-net-mvc-2/</link>
		<comments>http://blog.didsburydesign.com/2010/02/how-to-allow-hyphens-in-urls-using-asp-net-mvc-2/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 14:28:03 +0000</pubDate>
		<dc:creator>Didsbury Design</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C-Sharp]]></category>
		<category><![CDATA[Hyphens]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MVC 2.0]]></category>
		<category><![CDATA[URL Routing]]></category>

		<guid isPermaLink="false">http://blog.zero7web.com/?p=200</guid>
		<description><![CDATA[If you wan&#8217;t to allow hyphens in your URL&#8217;s you will need to change the way the routing works in your Global.asax file.
First create a new class which extends the MvcRouteHandler and place this in the Global.asax file after the main MvcApplication class.
C#:

public class HyphenatedRouteHandler : MvcRouteHandler&#123;
	protected override IHttpHandler  GetHttpHandler&#40;RequestContext requestContext&#41;
	&#123;
		requestContext.RouteData.Values&#91;&#34;controller&#34;&#93; = requestContext.RouteData.Values&#91;&#34;controller&#34;&#93;.ToString&#40;&#41;.Replace&#40;&#34;-&#34;, &#34;_&#34;&#41;;
		requestContext.RouteData.Values&#91;&#34;action&#34;&#93; [...]]]></description>
			<content:encoded><![CDATA[<p>If you wan&#8217;t to allow hyphens in your URL&#8217;s you will need to change the way the routing works in your Global.asax file.</p>
<p>First create a new class which extends the <strong>MvcRouteHandler</strong> and place this in the <strong>Global.asax</strong> file after the main <strong>MvcApplication</strong> class.</p>
<p>C#:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">public class HyphenatedRouteHandler <span style="color: #339933;">:</span> MvcRouteHandler<span style="color: #009900;">&#123;</span>
	protected override IHttpHandler  GetHttpHandler<span style="color: #009900;">&#40;</span>RequestContext requestContext<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		requestContext.<span style="color: #202020;">RouteData</span>.<span style="color: #202020;">Values</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;controller&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> requestContext.<span style="color: #202020;">RouteData</span>.<span style="color: #202020;">Values</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;controller&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">ToString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">Replace</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		requestContext.<span style="color: #202020;">RouteData</span>.<span style="color: #202020;">Values</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;action&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> requestContext.<span style="color: #202020;">RouteData</span>.<span style="color: #202020;">Values</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;action&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #202020;">ToString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #202020;">Replace</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> base.<span style="color: #202020;">GetHttpHandler</span><span style="color: #009900;">&#40;</span>requestContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>VB:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Public</span> Class HyphenatedRouteHandler
    Inherits MvcRouteHandler
&nbsp;
    Protected Overrides <span style="color: #000080;">Function</span> GetHttpHandler(<span style="color: #000080;">ByVal</span> requestContext <span style="color: #000080;">As</span> System.Web.Routing.RequestContext) <span style="color: #000080;">As</span> System.Web.IHttpHandler
        requestContext.RouteData.Values(&quot;controller&quot;) = requestContext.RouteData.Values(&quot;controller&quot;).ToString.Replace(&quot;-&quot;, &quot;_&quot;)
        requestContext.RouteData.Values(&quot;action&quot;) = requestContext.RouteData.Values(&quot;action&quot;).ToString.Replace(&quot;-&quot;, &quot;_&quot;)
        Return MyBase.GetHttpHandler(requestContext)
    <span style="color: #000080;">End</span> <span style="color: #000080;">Function</span>
&nbsp;
<span style="color: #000080;">End</span> Class</pre></div></div>

<p>Then you need to replace the <strong>routes.MapRoute</strong> with an equivalent <strong>routes.Add</strong> specifying the new handler as the MapRoute does not allow you to specify a custom route handler.</p>
<p>C#:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">routes.<span style="color: #202020;">Add</span><span style="color: #009900;">&#40;</span>
	new Route<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;{controller}/{action}/{id}&quot;</span><span style="color: #339933;">,</span> 
		new RouteValueDictionary<span style="color: #009900;">&#40;</span>
			new <span style="color: #009900;">&#123;</span> controller <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Default&quot;</span><span style="color: #339933;">,</span> action <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Index&quot;</span><span style="color: #339933;">,</span> id <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			new HyphenatedRouteHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>VB:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">routes.Add(<span style="color: #000080;">New</span> Route(&quot;{controller}/{action}/{id}&quot;, 
	<span style="color: #000080;">New</span> RouteValueDictionary(<span style="color: #000080;">New</span> <span style="color: #000080;">With</span> {.controller = &quot;Home&quot;, .action = &quot;Index&quot;, .id = &quot;&quot;}), 
		<span style="color: #000080;">New</span> HyphenatedRouteHandler()))</pre></div></div>

<p>I hope this is useful, any questions feel free to get in touch.</p>
<p>Would like to say thanks to John from <a href="http://stackoverflow.com/questions/2070890/asp-net-mvc-support-for-urls-with-hyphens">here</a> for answering the original question on <a href="http://stackoverflow.com">Stackoverflow</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.didsburydesign.com/2010/02/how-to-allow-hyphens-in-urls-using-asp-net-mvc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
