Sunday, 20 January 2013 15:44

how to access html textarea element from code behind file

Written by 
Rate this item
(0 votes)

you will need to access html elements from asp.net
code behind file.i show you how to access widely used
html textarea element from code behind file -

suppose you have a textarea element in datalist
control -

<asp:DataList ID="DataList2">
<ItemTemplate>
........
<textarea id="item" runat="server" rows="7" class="textarea"
readonly="readonly">
</textarea>
</ItemTemplate>
</asp:DataList>

in your code behind file -

string comment="etc";
HtmlTextArea setrows = (HtmlTextArea)DataList1.Items[y].FindControl("commenthold");
setrows.Value = comment;//assign value in the textarea

this may be easy.but this will give you knowledge about how
you will access any html element from asp.net code behind
page.

Read 3514 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest discussions

  • No posts to display.