<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6593385603115410068</id><updated>2011-07-08T06:17:36.586-07:00</updated><title type='text'>Raj at ASP.NET</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rajwebaspnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6593385603115410068/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rajwebaspnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Raj Aththanayake</name><uri>http://www.blogger.com/profile/13604015600885421070</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_6fvSoXQccJ4/SscP5QwW7rI/AAAAAAAAAAc/aVhFodCPHbY/S220/photo1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6593385603115410068.post-2181600031212813360</id><published>2010-02-21T03:12:00.000-08:00</published><updated>2010-02-21T03:13:26.852-08:00</updated><title type='text'>URL Routing in ASP.NET 4.0</title><content type='html'>In ASP.NET MVC you can have clean nice SEO friendly Url. &lt;br /&gt;For example:&lt;br /&gt;- http://mySite.com.au/Category/List &lt;br /&gt;- http://mySite.com.au/Product/Detail&lt;br /&gt;&lt;br /&gt;However with ASP.NET 3.5 SP1, Webforms require an implementation of an IRouteHandler to support clean nice Url. &lt;br /&gt;This can be quite tedious, and often require more work. &lt;br /&gt;&lt;br /&gt;However with ASP.NET 4.0, you can add this support easily without having to use or implement an IRouteHandler. &lt;br /&gt;&lt;br /&gt;The below two articles explain how to achieve this in web forms.&lt;br /&gt;&lt;br /&gt;http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx &lt;br /&gt;&lt;br /&gt;http://www.4guysfromrolla.com/articles/012710-1.aspx&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Helvetica, sans-serif; font-size: 12px;"&gt;Happy Programming!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6593385603115410068-2181600031212813360?l=rajwebaspnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajwebaspnet.blogspot.com/feeds/2181600031212813360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajwebaspnet.blogspot.com/2010/02/url-routing-in-aspnet-40.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6593385603115410068/posts/default/2181600031212813360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6593385603115410068/posts/default/2181600031212813360'/><link rel='alternate' type='text/html' href='http://rajwebaspnet.blogspot.com/2010/02/url-routing-in-aspnet-40.html' title='URL Routing in ASP.NET 4.0'/><author><name>Raj Aththanayake</name><uri>http://www.blogger.com/profile/13604015600885421070</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_6fvSoXQccJ4/SscP5QwW7rI/AAAAAAAAAAc/aVhFodCPHbY/S220/photo1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6593385603115410068.post-1046751826632465435</id><published>2009-10-03T01:54:00.000-07:00</published><updated>2009-10-03T02:20:05.056-07:00</updated><title type='text'>Using C# 3.0 Anonymous Types as Dictionaries</title><content type='html'>&lt;div&gt;public static string GetHtmlLink(string text, IDictionary&lt;string, string=""&gt; properties)&lt;/string,&gt;&lt;/div&gt;&lt;string, string=""&gt;{&lt;br /&gt; //do some work&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//too many lines and less efficient&lt;br /&gt;Dictionary&lt;string, string=""&gt; values = new Dictionary&lt;string, string=""&gt;();&lt;br /&gt;values.Add("key1", "value1");&lt;br /&gt;values.Add("key2", "value2");&lt;br /&gt;values.Add("key3", "value3");&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;GetHtmlLink("Click me", values);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;//better&lt;br /&gt;MyParams myParams = new MyParams { Key1 = "value1", Key2 = "value2", Key3 = "value3" };&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;GetHtmlLink("Click me", myParams);&lt;/span&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;/string,&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 19px; font-weight: normal; "&gt;&lt;pre class="code"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Sample link: &lt;/span&gt;&lt;span style="background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 238, 98); background-position: initial initial; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;%&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;/span&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;HtmlHelpers&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;.GetHtmlLink(&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;"My Site"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; { @class = &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;"someStyle"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;, href = &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;"http://www&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; color: rgb(51, 51, 51); "&gt;And it'll render this HTML:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma, serif;"&gt;&lt;span class="Apple-style-span"  style=" white-space: pre;font-size:-webkit-xxx-large;"&gt;&lt;span class="Apple-style-span"   style="font-family:Georgia, serif;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style=" white-space: normal;font-size:16px;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(51, 51, 51);   font-family:Verdana, Arial, Helvetica, sans-serif;font-size:19px;"&gt;&lt;pre class="code"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Sample link: &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="someStyle"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;href&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;="http://www.example.org"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;My Site&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;br&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;/&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Sample URL: http://www.example.org/search?query=kitten's+mittens&amp;amp;mode=details&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;from &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="  font-weight: normal; white-space: pre; font-family:Tahoma;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://weblogs.asp.net/leftslipper/archive/2007/09/24/using-c-3-0-anonymous-types-as-dictionaries.aspx&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Tahoma, serif;"&gt;&lt;span class="Apple-style-span" style=" white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6593385603115410068-1046751826632465435?l=rajwebaspnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rajwebaspnet.blogspot.com/feeds/1046751826632465435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rajwebaspnet.blogspot.com/2009/10/using-c-30-anonymous-types-as.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6593385603115410068/posts/default/1046751826632465435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6593385603115410068/posts/default/1046751826632465435'/><link rel='alternate' type='text/html' href='http://rajwebaspnet.blogspot.com/2009/10/using-c-30-anonymous-types-as.html' title='Using C# 3.0 Anonymous Types as Dictionaries'/><author><name>Raj Aththanayake</name><uri>http://www.blogger.com/profile/13604015600885421070</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_6fvSoXQccJ4/SscP5QwW7rI/AAAAAAAAAAc/aVhFodCPHbY/S220/photo1.jpg'/></author><thr:total>0</thr:total></entry></feed>
