I have an EditItemTemplate within a ASP.NET 4.5 Web Forms FormView. I've set an ItemType on the FormView so I'm using DynamicControls to display and edit fields.
<asp:FormView runat="server" ItemType="FooModel">
<EditItemTemplate>
<asp:DynamicControl runat="server" ID="message" DataField="Message" Mode="Edit" />
</EditItemTemplate>
</asp:FormView>
This seems to work ok until I set the DataType on my ItemType property to make it multiline, like so.
public class FooModel
{
[DataType(DataType.MultilineText)]
public string Message { get; set; }
}
This still gives me a standard text input. Any ideas?
I could work around it by using
<asp:TextBox ID="Message" Text='<%# Bind("Message") %>' runat="server" TextMode="MultiLine" />
...but it would be nicer to just infer it from the data type on my property.
Thanks