views:

131

answers:

3

I noticed that there is one change about ASP.NET Routing. I cannot understand why such change.

In ASP.NET MVC Preview, the routing setting in Global.ascx is like "[controller]/[action]/[id]". Now, it is changed to be "{controller}/{action}/{id}". Why change [] to {} ? Is there some necessity to do that?

+1  A: 

I'm not sure it's the reason why, but it does have the benefit of being much more like String.Format. Convention/less surprise is usually a good thing.

JasonTrue
+5  A: 

Wow, that happened a long while ago. Someday, I hope that the string class itself is augmented with named formats. Then this move will look like a very prescient move. We liked its similarity and consistency with string.format. Also, it is consistent with the UriTemplate format string.

Haacked
And how would YOU know :PMakes sense to have it the same as other formatting concepts in .NET
Slace
A: 

In a route, you define placeholders (referred to as URL parameters) by enclosing them in braces ( { and } ). The / character is interpreted as a delimiter when the URL is parsed.

So now why they changed their code for parsing placeholders from [ ] to { } is something which the developers would know better!!!

Samiksha
@Samiksha The developers have already answered the question. :)
bzlm