Home / ASP.NET Weblogs

December 2010 - Posts

Posted to:
by: 
12-17-2010, 2:23 AM

ASP.NET MVC 3: Implicit and Explicit code nuggets with Razor

This is another in a series of posts I’m doing that cover some of the new ASP.NET MVC 3 features: New @model keyword in Razor (Oct 19th) Layouts with Razor (Oct 22nd) Server-Side Comments with Razor (Nov 12th) Razor’s @: and <text> syntax (Dec 15th) Implicit and Explicit code nuggets with Razor (today) In today’s post I’m going to discuss how Razor enables you to both implicitly and explicitly define code nuggets within your view templates, and walkthrough some code examples of each of them.  Fluid Coding with Razor ASP.NET MVC 3 ships with a new view-engine option called “Razor” (in addition to the existing .aspx view engine).  You can learn more about Razor, why we are introducing it, and the syntax it supports from my Introducing...
Filed under: , , ,
Posted to:

How to solve Visual Studio hang problem when working in win7 with Norton antivirus

A recent support email between customer and our developer shows that Norton/Symantec antivirus may affect Visual Studio’s performance in win7 due to the win7 jumplists.  Here’s a workaround for it:   First, to determine if this is the problem, you may want to disable the antivirus temporarily and see if these hangs still repro. If it’s indeed the case, please create/set the following registry value and restart VS2010. [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\General] "ShowRecentFilesInJumplist"=dword:00000001   With the value set, Visual Studio will not try to remove anymore the files from the Win7 jumplists , which would reduce the chance of an antivirus interfering (at least during file saves)  ...
Posted to:
by: 
12-16-2010, 12:02 PM

MSJoe.com Podcast Episode #2 - Orchard Project 0.8

Episode #2 - Orchard Project 0.8 Microsoft Orchard is an exciting new CMS - Application Development Platform from Microsoft. It's free, flexible and powerful. As Orchard approaches V1 release Joe catches up with the driving forces behind the project! [ Listen – Download – Subscribe HERE ]   Technorati Tags: Microsoft , MSJoe , Podcast , Orchard , Open Source Read More...
Posted to:
by: 
12-16-2010, 2:48 AM

ASP.NET MVC 3: Razor’s @: and <text> syntax

This is another in a series of posts I’m doing that cover some of the new ASP.NET MVC 3 features: New @model keyword in Razor (Oct 19th) Layouts with Razor (Oct 22nd) Server-Side Comments with Razor (Nov 12th) Razor’s @: and <text> syntax (today) In today’s post I’m going to discuss two useful syntactical features of the new Razor view-engine – the @: and <text> syntax support. Fluid Coding with Razor ASP.NET MVC 3 ships with a new view-engine option called “Razor” (in addition to the existing .aspx view engine).  You can learn more about Razor, why we are introducing it, and the syntax it supports from my Introducing Razor blog post.  Razor minimizes the number of characters and keystrokes required when writing a view...
Filed under: , ,
Posted to:

Switching the layout in Orchard CMS

The UI composition in Orchard is extremely flexible, thanks in no small part to the usage of dynamic Clay shapes. Every notable UI construct in Orchard is built as a shape that other parts of the system can then party on and modify any way they want. Case in point today: modifying the layout (which is a shape) on the fly to provide custom page structures for different parts of the site. This might actually end up being built-in Orchard 1.0 but for the moment it’s not in there. Plus, it’s quite interesting to see how it’s done. We are going to build a little extension that allows for specialized layouts in addition to the default layout.cshtml that Orchard understands out of the box. The extension will add the possibility to add the module name...
Filed under: , ,
Posted to:
by: 
12-14-2010, 7:53 PM

Update on ASP.NET MVC 3 RC2 (and a workaround for a bug in it)

Last week we published the RC2 build of ASP.NET MVC 3.  I blogged a bunch of details about it here . One of the reasons we publish release candidates is to help find those last “hard to find” bugs. So far we haven’t seen many issues reported with the RC2 release (which is good) - although we have seen a few reports of a metadata caching bug that manifests itself in at least two scenarios: Nullable parameters in action methods have problems : When you have a controller action method with a nullable parameter (like int? – or a complex type that has a nullable sub-property), the nullable parameter might always end up being null - even when the request contains a valid value for the parameter. [AllowHtml] doesn’t allow HTML in model binding...
Filed under: , , ,
Posted to:

Visual Studio 2010 SP1 Beta IIS Express Integration

A few days ago Jason Zander blogged about the availability of Visual Studio SP1 Beta (all links below in resources section). I am happy to let you guys know that with SP1 Beta we have enabled integration of IIS Express into Visual Studio. After you have installed SP1 Beta you have to download IIS Express separately for the option to “light up”. After you’ve downloaded and installed IIS Express you can now create Web projects and Websites which use IIS Express instead of Cassini (the default web server used in Visual Studio). For more information regarding the difference between IIS Express and IIS/Cassini please see Scott’s blog linked below. Visual Studio 2010 has two types of web projects; Web Application Project (WAP) and Website projects...
Posted to:
by: 
12-11-2010, 2:47 AM

Announcing ASP.NET MVC 3 (Release Candidate 2)

Earlier today the ASP.NET team shipped the final release candidate (RC2) for ASP.NET MVC 3.  You can download and install it here . Almost there… Today’s RC2 release is the near-final release of ASP.NET MVC 3, and is a true “release candidate” in that we are hoping to not make any more code changes with it.  We are publishing it today so that people can do final testing with it, let us know if they find any last minute “showstoppers”, and start updating their apps to use it.  We will officially ship the final ASP.NET MVC 3 “RTM” build in January. Works with both VS 2010 and VS 2010 SP1 Beta Today’s ASP.NET MVC 3 RC2 release works with both the shipping version of Visual Studio 2010 / Visual Web Developer 2010 Express, as well...
Filed under: , ,
Posted to:

ASP.NET MVC 3 Release Candidate 2

Almost exactly one month ago , we released the Release Candidate for ASP.NET MVC 3. And today we learn why we use the term “Candidate”. As Scott writes, Visual Studio 2010 SP1 Beta was released just this week and as we were testing it we found a few incompatibilities with it and the ASP.NET MVC 3 RC that we had just released. That’s when we, in the parlance of the military, scrambled the jets to get another release candidate prepared. You can install it directly using the Web Platform Installer (Web PI) download the installer yourself from from here . Be sure to read the release notes for known issues and breaking changes in this release. I’m not saying I put an Easter egg in there or not, but you’ll have to read all the notes to find out. In...
Posted to:
by: 
12-10-2010, 4:05 AM

Class-Level Model Validation with EF Code First and ASP.NET MVC 3

Earlier this week the data team released the CTP5 build of the new Entity Framework Code-First library.  In my blog post a few days ago I talked about a few of the improvements introduced with the new CTP5 build.  Automatic support for enforcing DataAnnotation validation attributes on models was one of the improvements I discussed.  It provides a pretty easy way to enable property-level validation logic within your model layer. You can apply validation attributes like [Required], [Range], and [RegularExpression] – all of which are built-into .NET 4 – to your model classes in order to enforce that the model properties are valid before they are persisted to a database.  You can also create your own custom validation attributes...
Filed under: , , ,

< Previous 1 2 3 4 Next >

Archives