Created
September 5, 2012 14:38
-
-
Save martinnormark/3637594 to your computer and use it in GitHub Desktop.
Use HtmlHelper from MVC Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string Test() | |
{ | |
TextWriter tw = TextWriter.Null; | |
HtmlHelper<TestViewModel> htmlHelper = new HtmlHelper<TestViewModel>(new ViewContext(ControllerContext, | |
new RazorView(ControllerContext, "asd", "sdsd", false, null), | |
new ViewDataDictionary(), | |
new TempDataDictionary(), tw), new ViewPage()); | |
return htmlHelper.TextBoxFor(m => m.Name).ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment