RSSCategory: MVC4



Escaping Razor View @ Symbol in MVC project

Posted by 1 Comment

To escape the Razor View’s @ symbol in an MVC project you can either use double @ signs:


Or you can use Html.Raw to display the symbol:




Missing System.Web.Optimization in MVC4

Posted by 5 Comments

Opening up a MVC4 project in Visual Studio 2010 can sometimes result in a missing System.Web.Optimization errors. You can install the missing packages by using the Package Manager Console from the Tools -> Library Package Manager menu as shown below.

Continue Reading



Using jQuery dialog in an MVC4 Mobile App

Posted by 4 Comments

According the jQuery Mobile Documentation for dialogs, you would open the dialog by adding


to the link. However, in an MVC4 Mobile app you need to add data_rel (note the ‘_’ not ‘-‘) to your actionlink like so:

@Html.ActionLink("Log in", "Login", "Account", routeValues: null, 
  htmlAttributes: new { data_icon = "gear", data_rel = "dialog" })

Continue Reading