When you use MvcContrib grid sorting out-of-the-box, it automatically appends the querystrings Column and Direction to your URL. For instance:
www.mysite.com/listing?Column=Bedrooms&Direction=Ascending
Is there a way to lowercase the querystrings (Column and Direction) so that you get this:
www.mysite.com/listing?column=Bedrooms&direction=Ascending
I’m using ASP.NET MVC 3 with MvcContrib version 3.
Unfortunately those values are hardcoded in the
MvcContrib.UI.Grid.HtmlTableGridRenderer<T>class:The
CreateRouteValuesForSortOptionsprivate method is invoked by theRenderHeaderTextvirtual protected method. So if you want to have lowercase parameter names one possibility would be to write a customGridRenderer<T>.Another possibility is to write a custom Route to make urls lowercase. You may take a look at the following blog post which illustrates how to make all urls in an application to be lowercase but you could tweak it to your needs.