C# – ASP.NET MVC 3 Reusable Table Display Template with Razor

asp.net-mvc-3crazor

Is there a good way for creating a tabular display template in ASP.NET MVC3 with the new Razor syntax?

In ASP.NET MVC 2 Phil Haack was blogging about tabular display templates.
Is there a better approach in ASP.NET MVC3?

EDIT:

Is it also possible to render the grid on the basis of the model meta data? So I do not want to manually define the columns with the WebGrid API but with model meta data. The problem I see is that you everytime have to define the table by hand using the WebGrid API. I want to have the possibility to have one kind of table that is reusable!

Edit:
So is there any good practice for creating grids using model meta data?

Best Answer

You can use the new WebGrid in MVC3:

@{
    var grid = new WebGrid(Model);
    @grid.GetHtml();
}

And you can use jQuery tabs: http://jqueryui.com/demos/tabs, to create tab pages.

Sorry if I am misunderstood your question.