Wednesday, November 23, 2011

using MvcHtmlString as a layer of C# between a Razor view and a call to a Razor partial

@Html.ShuffleList(properties here)

 
 

The code above in a Razor view reaches out to the following in HtmlHelperExtensions at OurApp.Web.UI\Helpers\HtmlHelper.cs which does not keep its contents inside of a using statement.

public static MvcHtmlString ShuffleList<properties here>(properties here)

{

   
code here

   return htmlHelper.Partial("_ShuffleList", model);

}

 
 

Note, at the last line we are grabbing the HTML out of a partial. The middle layer provides a forum to prep the model handed to the partial.

No comments:

Post a Comment