Using DataList, it's not possible to collect data into a <textarea></textarea>
HTML tag. Because Visual Studio automaticly adds table
and so td
and shows data in t开发者_Go百科hese HTML tags.
I want to show bunch of "added tags" in a passive-looking <textarea>
. How can I do it? Is it possible to use data piece by piece WITHOUT any pre-constructed HTML tag. I don't want any td
...
How to do that?
Use a repeater :
<asp:Repeater runat="server" id="rpGeneratedTags">
<headertemplate>
<textarea name="generatedTags">
</headertemplate>
<footertemplate>
</textarea>
</footertemplate>
<itemtemplate>
<%# System.Web.HttpUtility.HtmlEncode((string)Eval("Tag") %#>
</itemtemplate>
</asp:Repeater>
精彩评论