472,353 Members | 1,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Problem with MultiLine TextBox

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

Nov 17 '05 #1
7 3869
Jj
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

Nov 17 '05 #2
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

Nov 17 '05 #3
Try a simpler example and see if you get the same behavior. I just created a form with a multiline textbox, initialized it with data, ran it, caused a postback, initial data still there, changed the text, caused a postback, and the changed data is coming back with the new text as expected. I have also used multiline textbox in database applications and have never seen the behavior you are stating.
"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

Nov 17 '05 #4
Jj
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

Nov 17 '05 #5
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

Nov 17 '05 #6
Indeed, a simple form with two TextBoxes, one SingleLine and one MultiLine, works fine.

Joel Finkel
fi****@sd-il.com

"Anon" <An**@Anon.Anon> wrote in message news:v4yrb.115701$ao4.350501@attbi_s51...
Try a simpler example and see if you get the same behavior. I just created a form with a multiline textbox, initialized it with data, ran it, caused a postback, initial data still there, changed the text, caused a postback, and the changed data is coming back with the new text as expected. I have also used multiline textbox in database applications and have never seen the behavior you are stating.
"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

Nov 17 '05 #7
Folks,

Pilot error. The problem was that I was cloberring the results in the Page_Load event handler by misplacing code outside the if !IsPostBack check. Like most bugs, it was hard to find and easy to fix. THanks for your time.

Joel Finkel
fi****@sd-il.com

"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

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suresh Kumaran | last post by:
Hi All, Does anybody know the sytax in VB.NET to write the contents of a multiline text box to a text file? Appreciate help. Suresh
3
by: PawelR | last post by:
Hi, I use dataGrid to show data from DataBase. In one table I've text field (varchar 2048) and data in this field is very long (more characters)....
8
by: David | last post by:
This is something I had never seen before. On an aspx page, upon pressing a link button for which I have an event handler in the code behind, the...
3
by: Antonio Lopez Arredondo | last post by:
hi all again..... I have an ASP.NET application that has a multiline textbox and a single button. the user should be able to write inside the...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right...
2
by: Mike | last post by:
I am trying to write a little program for my own use using VB2005 express edition. I have a list of peoples names in a file that I read into an...
7
by: Anil Gupte | last post by:
I have read a lot about getting lines from a multiline textbox in VB.Net. However, I cannot for the life of me figure out how to write to a...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form,...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.