Scott Gu recently posted on his BLOG regarding the ability to use nicely formatted URL's in .NET framework 4.0. In the past this has been achievable using in ASP.NET MVC and also through the use of a ISAPI / HTTP module which required configuration.
This same functionality is now available through the use of the MapPageRoute() helper method.
The result is a URL that is more searchable by search engines (SEO friendly) and one which is more informative the user.
Further information can be found in this link:
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
Our BLOG. A place for the useful and not so useful thoughts and ponderings of the Mayfly Media team.
Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts
Thursday, 22 April 2010
Regular expression for PascalCased enums into words.
Ever used an enum to reference values that come out of the database? Of course you have, now you can use this regular expression that I syumbled for turning pascal cased strings (i.e. Enum values) to a string with the necessary spaces in - i.e. MyEnumValue comes out as "My Enum Value".
System.Text.RegularExpressions.Regex.Replace(text, "[A-Z]", " $0").Trim();
System.Text.RegularExpressions.Regex.Replace(text, "[A-Z]", " $0").Trim();
What to do with ASP.NET exceptions and specifically handling ELMAH!
Ever wonder which is the best way to report your elmah based asp.net exceptions?
Should you send the error to an email address - what if the recipient is on holiday?
Should we send the exception emails to a centralized account - theres a lot of duplication there, and which recipient will deal with the email?
How about posting the exceptions to twitter - this is a bit too public for my liking do we really want connection strings etc being posted here?
How about this, a layer built on top of ELMAH to handle all of these requirements and automatically handle exceptions and presentation of these to the user in a beautiful way:
http://aspexceptionreporter.codeplex.com/
Your thoughts......
Should you send the error to an email address - what if the recipient is on holiday?
Should we send the exception emails to a centralized account - theres a lot of duplication there, and which recipient will deal with the email?
How about posting the exceptions to twitter - this is a bit too public for my liking do we really want connection strings etc being posted here?
How about this, a layer built on top of ELMAH to handle all of these requirements and automatically handle exceptions and presentation of these to the user in a beautiful way:
http://aspexceptionreporter.codeplex.com/
Your thoughts......
Subscribe to:
Posts (Atom)