Jianjun,
Here is some of the code. It is very simple. It is identical to code that is used for SingleLine TextBoxes.
/Joel
// declare the variable
protected System.Web.UI.WebControls.TextBox tbHowIHeard;
Inside of the Page_Load event handler:
// load the variable from the DataSource
tbHowIHeard.Text = drMember["HOW_I_HEARD", DataRowVersion.Original].ToString();
Inside of the bntSave_Click event hander:
// store the modified data
sqlUpdateCommand1.Parameters["@HOW_I_HEARD"].Value = tbHowIHeard.Text;
"Jj" <ji*******@yahoo.com> wrote in message news:q9********************@comcast.com...
Sorry, could you please post the code behinde too? How are you initializing the original text in the code behind?
Jianjun
"Joel Finkel" <fi****@sd-il.com> wrote in message news:e$**************@TK2MSFTNGP10.phx.gbl...
Sure, here is the HTML code for the TextBoxes that are MultiLine.
<asp:TextBox id="tbHowIHeard" style="Z-INDEX: 110; LEFT: 136px; POSITION: absolute; TOP: 522px" runat="server" Width="466px" Height="90px" CssClass="textBoxData" Rows="4" TextMode="MultiLine"></asp:TextBox>
<asp:TextBox id="tbActivities" style="Z-INDEX: 112; LEFT: 136px; POSITION: absolute; TOP: 636px" runat="server" Width="466px" Height="90px" CssClass="textBoxData" Rows="4" TextMode="MultiLine"></asp:TextBox>
<asp:TextBox id="tbVolunteer" style="Z-INDEX: 114; LEFT: 136px; POSITION: absolute; TOP: 752px" runat="server" Width="466px" Height="90px" CssClass="textBoxData" Rows="4" TextMode="MultiLine"></asp:TextBox>
/Joel Finkel
fi****@sd-il.com
"Jj" <ji*******@yahoo.com> wrote in message news:l_********************@comcast.com...
Post your code please (html). Are you missing runat=server in the multiline text box ?
Jianjun
"Joel Finkel" <fi****@sd-il.com> wrote in message news:uk**************@TK2MSFTNGP11.phx.gbl...
Folks,
I have a form that has several TextBoxes, some of which have the TextMode set to MultiLine. Each is pre-loaded with data from a database. The user is allowed to modify each entry.
The problem is that only the modified data from the SingleLine TextBoxes are returned. The original data are returned for the MultiLine TextBoxes. Also, if the page is sent to the server (for validation, for instance), only the modified data for the SingleLine TextBoxes have been saved in the ViewState and are redisplayed correctly. The original data are re-displayed in the MultiLine TextBoxes.
Examination of the HTML code shows that the only difference in the declaration is the addition of these attributes:
Rows="4" TextMode="MultiLine"
I wonder if other people have run into the same problem or have any suggestions as to how to solve this problem.
Thanks in advance.
Joel Finkel
fi****@sd-il.com