views:

52

answers:

1

Hi all, I wish to create a view like

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>

but I get an error saying that DateTime must be a reference type in order to use for parameter TModel.

Fair enough, but I google plenty of examples that implement just what I try to achieve.

Any clues as to what I need to change/install/update?

Any comments welcome,

Anders, Denmark

+1  A: 

The .NET 4 documentation doesn't show a constraint on TModel, but the .NET 3.5 docs do. I don't know the details of MVC versioning, but my guess is you need to upgrade to version 2 of MVC.

Jon Skeet
Ah, but of course! I'm nostalgically hanging on to good ol' 3.5 - guess it's time to upgrade, then (but I am using MVC 2).Thanks!
Anders Juul
@Anders: Are you using the final release of ASP.NET MVC 2, or a beta?
Jon Skeet
I was using a beta (as it turned out!) - I got upgraded to to MVC 2 while I was at it...
Anders Juul