Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. public static MvcHtmlString TextBoxFor(this HtmlHelper html, ModelProperty prop, object htmlAttributes)
  2. {
  3. prop.ControlHtmlAttributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);
  4. return PartialExtensions.Partial(html, "MyView", prop);
  5. }
  6.  
  7. Html.TextArea(Model.ControlName, Model.Value, Model.ControlHtmlAttributes);
  8.  
  9. public static object ToAnonymousObject(this IDictionary<string, object> @this)
  10. {
  11. var expandoObject = new ExpandoObject();
  12. var expandoDictionary = (IDictionary<string, object>) expandoObject;
  13.  
  14. foreach (var keyValuePair in @this)
  15. {
  16. expandoDictionary.Add(keyValuePair);
  17. }
  18. return expandoObject;
  19. }
  20.  
  21. Html.TextArea(Model.ControlName, Model.AsString(), Model.ControlHtmlAttributes);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement