Can I have an example of how to use a template view to display an interface have properties ID and Name
A:
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; }
}
There you go. Hope that helps!
Yngve B. Nilsen
2010-08-11 11:04:49