Monday, November 14, 2011

wrapping partials in "method-driven" controls in Razor

I need to troubleshoot a control today which is called like this:

@Html.UserSelectControl(new UserSelectModel("User(s)", "PMProfileBackingStore"))

 
 

in OurUI/Helpers/HtmlHelper.cs (where there is a class called HtmlHelperExtensions not wrapped in a namespace) we have:

public static MvcHtmlString UserSelectControl(this HtmlHelper htmlHelper,

      UserSelectModel model)

{

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

}

 
 

_UserSelectControl, a partial, starts out like so exposing that the wrapping method hands in a model:

@model UserSelectModel
@{

No comments:

Post a Comment