I have a dialog popup with a textearea, two listboxes and one button. By selecting a value in the first listbox and pressing the button “>” the selected value is passed to the second listbox. This is done with asp.net ajax.
<td>
<div align="center">
<textarea style="height:50px; overflow:hidden;";rows="20"
cols="40"
id="editor1"
class="tinymce">
</textarea>
</div>
</td>
I put the 2 listboxes and the button between asp.net uploadpanel. Like this:
<td>
<asp:UpdatePanel runat="server" id="updatePanel1">
<ContentTemplate>
<table width="100%" align="left">
<tr>
<td colspan="5">
<hr align="left" style="width:95%" />
</td>
</tr>
<tr>
<td valign="top">
<cc1:SWCListBox
ID="SWCListBox1"
runat="server"
Width="100"
SelectionMode="Single"
CssClass="VW1">
</cc1:SWCListBox>
</td>
<td
valign="top"
width="50"
align="center">
<cc1:SWCButton
Text=" > "
ID="SWCBtnAddValue"
CssClass="VW1 VWButton"
runat="server"
ToolTip="Add to list"
OnClick="AddValue_Click"
CausesValidation="false"
/>
<td valign="top">
<cc1:SWCListBox
id="SWCListBox2"
CssClass="VW1"
runat="server"
Width="100"
SelectionMode="Single"
/>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
The probles is that when I type something in the textarea and make an async postback the text typed fades.
How can I keep the textarea value within async postbacks?
thank you.
This problem is because you use UpdatePanel, and the textarea is not an asp.net control. You have two solutions.
1) Make it asp.net control by placing the run=”server” (or)
2) Place the post back value manually as:
and on code behind
(because you use UpdatePanel its important to use Literal to add this value and not use
<%=%>, or else its throw an error.