MVC display moves if there is a scrollbar.

Use this in the _layouts view to prevent the annoying left twitch if the content is longed than can fit on the display. The scrollbar moved the display to the left unless you put this in the _layouts View.

       /* prevent layout shifting and hide horizontal scroll */
        html {
            width: 100vw;
        }

        body {
            overflow-x: hidden;
        }

MVC Blank Space Above Navbar

I recently came across a very annoying "feature" when developing an MVC5 site, and it took a few hours to resolve.

The white/blank above the navbar is the issue. To resolve this I added a margin-top: -50px in the Header of the _layouts view and all other _layouts that I had developed. Now it looks like this.

<style>
        body {
            margin-top: -50px;
        }
</style>

ASP.NET MVC 4 - Allow dashes hypens in URLs

Check this link too. This works for MVC 5 too: http://stackoverflow.com/questions/12433736/asp-net-mvc-4-allow-dashes-hypens-in-urls

Dashed urls are much more SEO friendly and easier to read. (More on my blog post)

NuGet Package: https://www.nuget.org/packages/LowercaseDashedRoute/

To install it, simply open the NuGet window in the Visual Studio by right clicking the Project and selecting NuGet Package Manager, and on the "Online" tab type "Lowercase Dashed Route", and it should pop up.

Alternatively, you can run this code in the Package Manager Console:

Install-Package LowercaseDashedRoute

After that you should open App_Start/RouteConfig.cs and comment out existing route.MapRoute(...) call and add this instead:

routes.Add(new LowercaseDashedRoute("{controller}/{action}/{id}",
  new RouteValueDictionary(
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }),
    new DashedRouteHandler()
  )
);

That's it. All the urls are lowercase, dashed, and converted implicitly without you doing anything more.

Open Source Project Url: https://github.com/AtaS/lowercase-dashed-route