Below you will find pages that utilize the taxonomy term “MVC”

Laravel User Authentication with Ajax Validation

This post documents how to add Ajax form validation to Laravel User Authentication that is generated by the Artisan console.

Razor Foreach Loop with Index

I recently needed to get the index of an item in a razor foreach loop. This simple solution posted as a comment by Ian Mercer on Phil Haack’s blog did the trick easily.

jQuery Mobile Cascaded Selects using MVC4 and KnockoutJs

This post documents building cascading select inputs using jQuery and Knockout for the user interface and MVC4 to serve the content.

Chinook ASP.NET MVC 4 Web Application

For this tutorial, you will need: Visual Studio Express 2012 for Windows 8 download details SQL Server Express Database using Visual Studio 2012 with SQL Server Express in this tutorial. Other versions may work (untested). msdn.microsoft.com Chinook database github.com/jimfrenette/chinookdatabase SQL Server 2012 Express Management Studio download details In Visual Studio, create a new C# ASP.NET MVC 4 Web Application: Next, select the Mobile Application Project Template. This template includes jQuery, jQuery intellisense for Visual Studio, jQuery Mobile and Knockoutjs javascript files.

C# Strip HTML and Attributes in MVC

If you are receiving this error message when posting content that contains HTML: A potentially dangerous Request.Form value was detected from the client Add ValidateInput(false) to your controller’s HttpPost method: [HttpPost, ValidateInput(false)] Take a look at this blog article for the class that does the HTML strip work, http://www.dijksterhuis.org/safely-cleaning-html-with-strip_tags-in-csharp/. In my implementation, the list of allowed tags is a string in the web.config: <configuration> <appSettings> <add key="HtmlAllowed" value="a,b,br,em,i,p,strong"/> </appSettings> </configuration> The settings class contains this line to set the HtmlAllowed web.

MVC 3 RSS Reader

Model public class Feed { public string Title { get; set; } public string Link { get; set; } public string Description { get; set; } } Controller public ActionResult Index() { XDocument feedXML = XDocument.Load("http://feeds.haacked.com/haacked"); //select out a collection of anonymous types from RSS feed var feedCollection = from rss in feedXML.Descendants("item") select new Feed { Title = rss.Element("title").Value, Link = rss.Element("link").Value, Description = rss.Element("description").Value }; return View(feedCollection); } View @model IEnumerable<RssReader.

MVC 3 Razor on a Shared .NET Host

Required: Visual Studio 2010 SP1 [microsoft.com/downloads/en/…]** IIS Manager for Remote Administration [www.iis.net/download/iismanager]** ASP.NET 4, MVC 3 hosting. I use winhost.com. ** Get using Web Platform Installer The following steps are needed to deploy the MVC3 and Razor libraries to the shared server for the application to run. This is a new feature you get when you update your Visual Studio to SP1. To get your MVC project running on the host, prepare it by right clicking on it in the solution explorer and select Add Deployable Dependencies.

MVC 3

A month ago, MVC 3 was released. Given it’s maturity level and features, I have decided it’s time to start building web apps with it instead of web forms.