my problem is the following I have an instance of a class and a HtmlTextWriter. Now i want to generate the Editor like in the View. The HtmlHelper is present and the methods Editor, TextBox ... too.
public class Class
{
public string Test { get; set; }
}
HtmlTextWriter writer = new HtmlTextWriter(new StringWriter());
Class a = new Class(); //
a.Test = "Lorem ipsum";
how can i do this to get a TextBox and all the goodness of Validations (DataAnnotations) ?
writer.Write(HtmlHelper.Editor(x => ....).ToString());
Have a nice day !