473,721 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Multi Line"

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 4047
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******** ******@TK2MSFTN GP11.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="Multi Line"

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="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbActivitie s" style="Z-INDEX: 112; LEFT: 136px; POSITION: absolute; TOP: 636px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbVolunteer " style="Z-INDEX: 114; LEFT: 136px; POSITION: absolute; TOP: 752px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

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

"Jj" <ji*******@yaho o.com> wrote in message news:l_******** ************@co mcast.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******** ******@TK2MSFTN GP11.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="Multi Line"

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******** ******@TK2MSFTN GP11.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="Multi Line"

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$******** ******@TK2MSFTN GP10.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="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbActivitie s" style="Z-INDEX: 112; LEFT: 136px; POSITION: absolute; TOP: 636px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbVolunteer " style="Z-INDEX: 114; LEFT: 136px; POSITION: absolute; TOP: 752px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

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

"Jj" <ji*******@yaho o.com> wrote in message news:l_******** ************@co mcast.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******** ******@TK2MSFTN GP11.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="Multi Line"

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.W ebControls.Text Box tbHowIHeard;

Inside of the Page_Load event handler:

// load the variable from the DataSource
tbHowIHeard.Tex t = drMember["HOW_I_HEAR D", DataRowVersion. Original].ToString();

Inside of the bntSave_Click event hander:

// store the modified data
sqlUpdateComman d1.Parameters["@HOW_I_HEA RD"].Value = tbHowIHeard.Tex t;

"Jj" <ji*******@yaho o.com> wrote in message news:q9******** ************@co mcast.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$******** ******@TK2MSFTN GP10.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="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbActivitie s" style="Z-INDEX: 112; LEFT: 136px; POSITION: absolute; TOP: 636px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

<asp:TextBox id="tbVolunteer " style="Z-INDEX: 114; LEFT: 136px; POSITION: absolute; TOP: 752px" runat="server" Width="466px" Height="90px" CssClass="textB oxData" Rows="4" TextMode="Multi Line"></asp:TextBox>

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

"Jj" <ji*******@yaho o.com> wrote in message news:l_******** ************@co mcast.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******** ******@TK2MSFTN GP11.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="Multi Line"

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.1157 01$ao4.350501@a ttbi_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******** ******@TK2MSFTN GP11.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="Multi Line"

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******** ******@TK2MSFTN GP11.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="Multi Line"

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
12745
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
1434
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). How show this text in datagrid as multiline or which component use to show multiline date. Thx PawelR
8
2003
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 screen shows nothing but a line that says "true" up in the right upper corner of the browser. I have an XP and had just installed XP Service Pack II...against my better judgment. Please help. Thanks.
3
1913
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 many paragraphs in the multiline textbox and then click the button to run the code behind. the problem is that when the user presses the ENTER key to insert a new line in the listbox, the button's code behind is executed.
4
2093
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 on a Panel control during the 1st load_page event. Each question is displayed and answered, then result written to a SQL table. Then the next question is read from a table and displayed using the load_page event again. The questions display and function perfectly. The user anwers the question...
4
3158
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 and down to centralise it the form simply jumps further away, completely leaving the selector box area. Any ideas? VS 2003 and VB.Net This is a simple application at the moment but the form is inherited from a
2
3430
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 array of strings. I am using a multiline textbox to enter new, edit existing, and view the names in the array. This all works well, but now I want to be able to select one more names from the list displayed in the multiline textbox then click a button to copy the selected names into another list so...
7
15476
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 multiline textbox. Basically, I have created an array of strings which I want to "paste" into a multiline textbox. Any ideas? -- Anil Gupte www.keeninc.net www.icinema.com
2
2634
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, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9215
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.