All my dynamically generated action links, etc. create links like / A ccount / S etup. It looks weird.
I want all my links to be lowercase (value / account / setting). Any way to do this?
Take a look at http://goneale.com/2008/12/19/lowercase-route-urls-in-aspnet-mvc/ . You can find additional information in another stackoverflow thread in How can I have lowercase routes in ASP.NET MVC? .
The remaining posts have not yet reviewed the scenario in which you go to the root of your web directory. If you have a mapping that references the action of the HomeController index, you would like the following URL to appear:
mysite/home/ or even mysite/home/index
mysite/home/
mysite/home/index
No amount of using the Html helper function will change the fact that by default the following will be displayed in the browser location bar:
mysite/Home or mysite/home/index
mysite/Home
There is a simpler solution in the .NET Framework 4.5, the new RouteCollection.LowercaseUrls property , here is an example
Html:
public static class MyHtmlExtensions { public static string LowerActionLink(this HtmlHelper htmlHelper,someargs) { return String.ToLowerInvariant(htmlHelper.ActionLink(someArgs)); } }
Html.LowerActionLink Html.ActionLink
Source: https://habr.com/ru/post/1752183/More articles:git push, where is the hidden source code? - gitThe problem with realloc () in C. Always freezes, but compiles fine - cHow to change a local group policy program setting - group-policyКак перенаправить URL-адреса нижнего регистра ('questions/add_to_favorites/123') с символами подчеркивания в ASP.NET MVC2? - asp.net-mvc-2Env variables for plugins in PHP on Windows - windowsC ++: using std :: wstring in an API function - c ++Thread.Abort does not seem to throw a ThreadAbortException due to AcceptSocket - multithreadingEntity Framework - Entity Mapping Problem - .netMatching duplicate spaces with preg_replace - phpHow to transfer a view frame to it? - objective-cAll Articles