开发者

ASP.Net MVC, strongly typed view with DateTime not accepted?

I wish to create a view like

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?&开发者_Python百科gt;" %>

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜