2010-08-11 49 views

回答

0

SomeView.ascx:

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

ID: <%= Html.Encode(Model.Id) %> 
Name <%= Html.Encode(Model.Name) %> 

IMyInterface的:

public interface IMyInterface 
{ 
    int Id { get; set; } 
    string Name { get; set; } 
} 

你走了。希望有所幫助!