Domanda

Using model binding with the above like so:

<asp:FormView runat="server" ID="ConversationForm" DefaultMode="Edit"
    OnCallingDataMethods="ConversationForm_CallingDataMethods"
    ItemType="MyApp.Model.Conversation"
    DataKeyNames="ConversationID"
    SelectMethod="GetConversation"
    UpdateMethod="UpdateConversation"
    OnItemUpdated="Conversation_ItemUpdated">
    <EditItemTemplate>
        <fieldset>
            <legend>Conversation Notes:</legend>
            <ol>
                <asp:DynamicEntity runat="server" Mode="Edit" />
            </ol>
        </fieldset>
        <asp:Button ID="btnUpdate" runat="server" Text="Save" CommandName="Update" />
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" OnClick="btnCancel_Click" />
    </EditItemTemplate>
</asp:FormView>

The Conversation entity basically has one property, "Text", which should contain freeform text captured by the user.

The DynamicEntity control generates a simple textbox for this property as it has a datatype of string.

How do I tell it to create a multiline textbox instead?

Can I add some sort of data annotation to the Conversation class that will tell the Dynamic Templates to create a multiline textbox?

È stato utile?

Soluzione

It does not seem to be possible so I had to revert to using a static asp:Textbox control with the TextMode="MultiLine" property set.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top