Guest User

Untitled

a guest
Apr 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public static MvcHtmlString RenderLabelFor<TModel, TValue> (
  2. this HtmlHelper html,
  3. Expression<Func<TModel, TValue>> value,
  4. object htmlAttributes
  5. ) where TModel : class
  6. {
  7. TagBuilder builder = new TagBuilder("td");
  8. builder.MergeAttributes(new RouteValueDictionary(attributes)); // to convert an object into an IDictionary
  9. builder.InnerHtml = LabelExtensions.LabelFor(html, value).ToString();
  10. return MvcHtmlString.Create(builder.ToString(TagRenderMode.Normal));
  11. }
  12.  
  13. public static MvcHtmlString RenderLabelFor<TModel, TValue> (
  14. this HtmlHelper<TModel> html,
  15. Expression<Func<TModel, TValue>> value,
  16. object htmlAttributes
  17. )
  18. {
  19. ...
  20. }
Add Comment
Please, Sign In to add comment