Articles : Page 1 of 8
-
DropDownList and SelectListItem Array Item Updates in MVC
May 1216So I ran into an interesting behavior today as I deployed my first MVC 4 app tonight. I have a list form that has a filter drop down that allows selection of categories. This list is static and rarely changes so rather than loading these items from the database each time I load the items once and then cache the actual SelectListItem[] array in a static property. However, when we put the site online tonight we immediately noticed that the drop down list was coming up with pre-set values that...
-
Passing multiple POST parameters to Web API Controller Methods
May 1209ASP.NET Web API introduces a new API for creating REST APIs and making AJAX callbacks to the server. This new API provides a host of new great functionality that unifies many of the features of many of the various AJAX/REST APIs that Microsoft created before it - ASP.NET AJAX, WCF REST specifically - and combines them into a whole more consistent API. Web API addresses many of the concerns that developers had with these older APIs, namely that it was very difficult to build consistent REST sty...
-
ASP.NET MVC 4: What’s New for Mobile Development in ASP.NET MVC 4
May 1201With the popularity of mobile and tablet devices, it’s no surprise that improving the mobile Web site development experience was such a focus in ASP.NET MVC 4. What’s nice is how well it succeeded, as Keith Burnell explains. The article covers features in the upcoming release of ASP.NET MVC4 targeted specifically at mobile Web site development. These features range from making it easier to create a mobile specific sites to making it less work to get your standard MVC site displaying correctly ...
-
ASP.NET: Introducing the Navigation for ASP.NET Web Forms Framework
May 1201Take a fresh look at Web Forms with this new navigation framework that eliminates tight coupling and codebehind while providing for unit-tested data-bound code and many other advantages—enough to make an ASP.NET MVC application green with envy, according to creator Graham Mendick. Graham Mendick MSDN Magazine May 2012...
-
Entity Framework 4.3.1 Migrations and non English locale
Apr 1230A few days ago I started migrating a web app I was working on from ASP.NET MVC 3 and EF4 to ASP.NET MVC 4 and EF 4.3.1. All went well, except for some problems with the automatic generation of the DB scheme using EF Code First: it was creating the database, but no tables and not even the __MigrationHistory table added in 4.3; and during the execution of the schema generation an error was raised with a weird datetime conversion error. I tried this both on SQL Express 2005 and SQL Compact and I ...
-
GZip/Deflate Compression in ASP.NET MVC
Apr 1228A long while back I wrote about GZip compression in ASP.NET. In that article I describe two generic helper methods that I've used in all sorts of ASP.NET application from WebForms apps to HttpModules and HttpHandlers that require gzip or deflate compression. The same static methods also work in ASP.NET MVC. Here are the two routines: /// <summary> /// Determines if GZip is supported /// </summary> /// <returns></returns> public static bool IsGZipSupported() { string AcceptEncoding = HttpCon...
-
ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
Apr 1220So here's a binding behavior in ASP.NET MVC that I didn't really get until today: HtmlHelpers controls (like .TextBoxFor() etc.) don't bind to model values on Postback, but rather get their value directly out of the POST buffer. Effectively it looks like you can't change the display value of a control via model value updates on a Postback operation. To demonstrate here's an example. I have a small section in a document where I display an editable email address: This is what the form displa...
-
Great Free Course on Building ASP.NET MVC Apps With EF Code First, HTML5 and jQuery
Apr 1220Pluralsight has developed a great training course on Building ASP.NET MVC Apps with EF Code First, HTML5 and jQuery. It is presented by the most excellent Dan Wahlin, and is really comprehensive. Details of the course outline can be found here. Free 1-Month Subscription to the Course Pluralsight is offering a special promotion that allows you to get a free 1-month subscription to watch the above course as many time as you want at no cost. There is no obligation to buy anything at the end...
-
April 14th Links: ASP.NET, ASP.NET MVC, ASP.NET Web API and Visual Studio
Apr 1215Here is the latest in my link-listing blog series: ASP.NET Easily overlooked features in VS 11 Express for Web: Good post by Scott Hanselman that highlights a bunch of easily overlooked improvements that are coming to VS 11 (and specifically the free express editions) for web development: unit testing, browser chooser/launcher, IIS Express, CSS Color Picker, Image Preview in Solution Explorer and more. Get Started with ASP.NET 4.5 Web Forms: Good 5-part tutorial that walks-through build...
-
Wishful Thinking: Why can't HTML fix Script Attacks at the Source?
Apr 1215The Web can be an evil place, especially if you're a Web Developer blissfully unaware of Cross Site Script Attacks (XSS). Even if you are aware of XSS in all of its insidious forms, it's extremely complex to deal with all the issues if you're taking user input and you're actually allowing users to post raw HTML into an application. I'm dealing with this again today in a Web application where legacy data contains raw HTML that has to be displayed and users ask for the ability to use raw HTML as...

