开发者

How to retrieve data into a <textarea> HTML tag in C# / Visual Studio?

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜