<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"><channel><title>Creating a Route Constraint</title><link>http://asp.net</link><pubDate>Wed, 13 Apr 2011 11:50:11 GMT</pubDate><generator>umbraco</generator><description>Comments for Creating a Route Constraint</description><language>en</language><atom:link href="http://asp.net/rss/comments/27558" rel="self" type="application/rss+xml" /><item><title>Comment Posted by ravikrishnap</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Tue, 22 Jun 2010 06:15:02 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009180</guid><description><![CDATA[ <p>What &#39;@&#39; implies? and where can i get reference for all regular expressions.. like for string, float,.. </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ravikrishnap.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by gupta_g21</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 07 Jul 2010 10:14:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009354</guid><description><![CDATA[ <p>&#39;@&#39; in C# means that the string should be used as is ... with out taking the special characters </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/gupta_g21.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pollirrata</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 07 Jul 2010 12:48:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009357</guid><description><![CDATA[ <p>For RegEx reference look at <a rel="nofollow" href="http://regexplib.com/DisplayPatterns.aspx?cattabindex=2&amp;categoryId=3" target="_blank">regexplib.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pollirrata.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pollirrata</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 07 Jul 2010 12:54:08 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009358</guid><description><![CDATA[ <p>Does anybody know if it is possible to have multiple routes with the same structure? Something like</p><p></p><p>routes.MapRoute(</p><p>    &quot;Product&quot;,</p><p>    &quot;Product/{productId}&quot;,</p><p>    new {controller=&quot;Product&quot;, action=&quot;Details&quot;},</p><p>    new {productId = @&quot;\d+&quot; }</p><p> );</p><p></p><p>routes.MapRoute(</p><p>    &quot;Product&quot;,</p><p>    &quot;Product/{productName}&quot;,</p><p>    new {controller=&quot;Product&quot;, action=&quot;Details&quot;},</p><p>    new {productName = @&quot;[a-zA-Z]?&quot; }</p><p> );</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pollirrata.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by talktoanil</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Sat, 04 Sep 2010 05:35:49 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010115</guid><description><![CDATA[ <p>@pollirrata , you got answer for your question ? if yes then help me and post the updated one.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/talktoanil.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Chemical_Scum</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Mon, 27 Sep 2010 14:13:57 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010413</guid><description><![CDATA[ <p>@talktoanil, I think you can &quot;expand&quot; the regex to accept both types and then clear up what type of parameter you got inside the controller itself. However, that won&#39;t be an elegant solution for multiple types. On the other hand - what other type could it be besides an int or a string? passing floats in URLs, are we? :-)</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Chemical_Scum.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by devenh</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 17 Nov 2010 16:55:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000010978</guid><description><![CDATA[ <p>@pollirrata and @talktoanil i believe you will have to give each of your routes a unique name to use it or else you will get an error.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/devenh.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pradip.bobhate</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 01 Dec 2010 04:04:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011092</guid><description><![CDATA[ <p>Only one question </p><p> &quot;Product/{productId}&quot;,</p><p>I could see &#39;action&#39; is missing here but in default section action is there </p><p></p><p>quetion is how this framework knows that {productId} is &#39;action&#39; or &#39;id&#39;</p><p></p><p>    new {controller=&quot;Product&quot;, action=&quot;Details&quot;},</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/pradip.bobhate.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by CookieLoveNicky</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 22 Dec 2010 05:10:19 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000011274</guid><description><![CDATA[ <p>My question is something like what pradip.bobhate asked</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/CookieLoveNicky.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by raghavendravikas</title><link>http://asp.net/mvc/tutorials/controllers-and-routing/creating-a-route-constraint-cs</link><pubDate>Wed, 13 Apr 2011 11:50:11 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000012781</guid><description><![CDATA[ <p>public ActionResult Details(int productId)</p><p>        {</p><p>            return View();</p><p>        }</p><p></p><p>I guess it should be string productId, because /Product/apple did not work for me as stated in Unfortunately, the route will also match the following URLs:</p><p></p><p>/Product/blah</p><p>/Product/apple</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/raghavendravikas.jpg?forceidenticon=false&amp;dt=635045201400000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>