Generating ASP.NET MVC View Controls According to Xml Configurations

Monday, April 23, 2012

Generating ASP.NET MVC View Controls According to Xml Configurations Last week I was consulting about ASP.NET MVC at a customer. One of the customer project requirements is to generate forms according to Xml configuration files. In this post I’ll offer an end-to-end solution to this requirement. This solution can be rafactored to use databases or any other data sources in order to achieve the same results. Setting The Environment Create a new default internet ASP.NET MVC 3 web application: Pay attention to the folders I added such as Classes and ViewModels. The Classes...

Using HTML5 Server-Sent Events with JSON and ASP.NET MVC

Tuesday, April 10, 2012

Using HTML5 Server-Sent Events with JSON and ASP.NET MVC I’m getting ready for a session that I’m delivering at the end of this month. I wanted to create a sample for using HTML5 Server-Sent Events and decided to share that sample with my Blog’s readers. But before I write about the sample, lets get to know the Server-Sent Events HTML5 API. Server-Sent Events Server-Sent Events is an acronym to the HTML5 EventSource JavaScript API. The Server-Sent Events enable servers to push data over HTTP using push protocols. The data that is sent to the client-side must...

Avoiding Circular Reference for Entity in JSON Serialization

Monday, October 17, 2011

Avoiding Circular Reference for Entity in JSON Serialization One problem that I was facing yesterday while working on an ASP.NET MVC application was a JSON serialization issue. The problem was a circular reference caused by the DataContractJsonSerializer because of relations between the entity and other entities. In this post I’ll show you how you can use a simple workaround in order to avoid the problem.    The JSON Serialization Error Returning the output of the JSON method in an ASP.NET MVC controller with a JSON object graph based on an Entity Framework Code First object causes...

Razor Helpers Syntax

Tuesday, July 19, 2011

Razor Helpers Syntax One hidden gem of Razor View Engine is the declarative helper syntax. With this syntax we can create helper components that are stored as .cshtml files, and enable reusability of view code. The name of the syntax might sound familiar and it is since it reminds the HtmlHelper class that was provided as part of MVC 1. In this post I’ll explain the Razor helper syntax and discuss why it sounds familiar to HtmlHelper. @helper Syntax and The HtmlHelper Class When you want to encapsulate a view code and make it reusable you’ll...

ASP.NET MVC Model Binders

ASP.NET MVC Model Binders One thing that I’m always asked to talk about when I’m delivering ASP.NET MVC sessions or courses is Model Binders. In this post I’ll explain what are Model Binders in ASP.NET MVC and how you can use them in your MVC application. Model Binders ASP.NET MVC is providing a way to de-serialize complex types that are part of the incoming HTTP request input. After these types are de-serialize they are passed to the relevant controller’s action as method arguments. In the following controller action method code, during the execution of ASP.NET MVC...

My Sela Dev-Days Experience

Tuesday, June 28, 2011

My Sela Dev-Days Experience Today I finished my Sela Dev. Days experience. Sela Dev. Days is a conference which include 5 days, 15 top experts, 25 session, and a whole lot of attendees (around 600 people registered for this week). If you are not familiar with Sela Dev. Days you can go to the conference’s site. In the conference I had three tutorial days in three different subjects: ASP.NET MVC 3, EF Code First integration, and Razor: Oh My! In this one day tutorial...

Creating a Code First Database Initializer Strategy

Monday, May 30, 2011

Creating a Code First Database Initializer Strategy Yesterday I helped a colleague with his ASP.NET MVC 3 site deployment. That colleague implemented the data access layer using EF4.1 Code First. One of the restrictions that he had was that he didn’t have database permissions to create a new database and couldn’t use SQL Express or SQL CE in his application. Instead he had an empty database for his disposal in the hosting environment without a way to run SQL scripts… In such a situation the provided Code First database initializer strategies weren’t sufficient (he couldn’t drop or create...

Sela Dev. Days 2011

Friday, May 20, 2011

Sela Dev. Days 2011 Next month, June 26-30, Sela is going to have a mini conference – Sela Dev. Days. In the conference you will have the opportunity to meet Israel and world lead experts and learn about the new and coming Microsoft technologies that everyone will talk about in the next following years. The conference includes 25 one day workshop in subjects such as Silverlight 5, Parallel programing, Windows Phone Mango, ASP.NET MVC 3 and more. In the conference I’m having the following three workshop days: ASP.NET...

MIX11 Keynote Session Summary

Tuesday, April 12, 2011

MIX11 Keynote Session Summary I’m currently attending the MIX11 Keynote session. Here are some of the things that you might consider to checkout in the following weeks: IE10 Preview was released and can be download from here. A new tools update for ASP.NET MVC3 was released and includes: EF4.1 support jQuery 1.5 and Modernizr support Scaffolding support New Controller templates More WebMatrix update Orchard CMS new release Windows Azure new upgrades Access Control Service V2 Caching CDN support CodeProject

Installing a Production Server for ASP.NET MVC 2 – Part 2

Tuesday, March 1, 2011

Installing a Production Server for ASP.NET MVC 2 – Part 2 A few days ago I helped a client to solve a problem they had when they deployed an ASP.NET MVC 2 application. In a previous post I wrote about how you can install a production server in order to run ASP.NET MVC 2 application. The client team have installed the server according to the AspNetMVC2 MSI installer section (in my post) and then they used Phil Haack’s IIS6 Extension-less URLs solution to enable the routing engine. Life was beautiful and they were on the right track. ...