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
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">
<textarea id="item" runat="server" rows="7" class="textarea"

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 code behind

Read 3391 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.