Below you will find pages that utilize the taxonomy term “MVC4”
Blog
Visual Studio 2012 crashes when opening an ASP.NET MVC project with a cshtml open
A rather long title for this post, but that’s exactly what happened: when I opened an ASP.NET MVC 4 project with a cshtml view open, Visual Studio would crash with the error messages seen on the right. This would only occur if the first project I opened had a cshtml file open. When I opened another (type of) project first and then opened a project with a cshtml file open, the problem did not occur.
Blog
Debugging JavaScript with Visual Studio in an ASP.NET MVC 4 application
When debugging JavaScript in an ASP.NET MVC (4) application, it is not always enough to uncheck the ‘Disable script debugging’ checkboxes under ‘Tools’ – ‘Internet Options’ – ‘Advanced’ – ‘Browsing’. JavaScript inside a Razor view (a cshtml file) cannot be debugged from Visual Studio. To debug your JavaScript, move it to a separate .js file and link to that file from your Razor view. This way, breakpoints set in the JavaScript will be hit and you can debug from Visual Studio.
Blog
How To: Create an ActionLink with a Twitter Bootstrap icon in MVC4
Twitter Bootstrap is a… “Sleek, intuitive, and powerful front-end framework for faster and easier web development.” One of the nice things in Bootstrap is you can use icons from Glyphicons. To use these, you can simply use this markup <i class="icon-fire"></i> to get a nice fire icon.
Translating this into an ActionLink styled as a button in an MVC4 application would look something like the following:
@Html.ActionLink("<i class="icon-fire"></i> Invent fire", "fire", new { @class = "btn" }) Unfortunately, this renders as follows: