Solved

Textbox multiline property

Posted on 2012-12-28
9
277 Views
Last Modified: 2013-01-24
I have a textbox that has multiline property set.
I output my data here from another page.

When it loads Id like the textbox to treat the new data as a new line not a continuation text or append.
Each new data entered should start with
*

on my page load event, I have this code..

If dr("CommentsHist") is system.dbnull.value = false then
   textBox1.text = dr("CaommentsHist")
endif

Currently since textbox1 has mulitiline, each new data entered just appends it to previous data.

I prefer new line created everytime.
0
Comment
Question by:zachvaldez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 7

Accepted Solution

by:
Element1910 earned 330 total points
ID: 38727977
Try this:

If dr("CommentsHist") is system.dbnull.value = false then
   textBox1.text = dr("CaommentsHist") + Environment.NewLine
endif

Open in new window

0
 
LVL 7

Expert Comment

by:Element1910
ID: 38727979
I think you made a typo on your original question, but I left it as you wrote it, just in case ;)
0
 
LVL 7

Expert Comment

by:Element1910
ID: 38727989
You could also append the Environment.Newline to the data coming from the other webpage.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:zachvaldez
ID: 38728002
You could also append the Environment.Newline to the data coming from the other webpage--

show me how to please?

BTW the + Environment .newline adds as "," before the data such as example

,Testing8
0
 
LVL 7

Assisted Solution

by:Element1910
Element1910 earned 330 total points
ID: 38728018
Well you are passing the CommentsHist from another page into this page, correct?

If that's the case, then just add Environment.Newline to the end of the information you want to pass in the other webpage. ASP.NET will convert this Environment.Newline for you into the proper newline tag for the multiline TextBox.

Regarding the Environment.Newline adding in a "," before the data...I'm pretty sure that impossible. The Environment.Newline method will only create a newline break...it doesn't deal with text at all. You must have some data that put that "," in there. Double check if possible.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38728194
Looks like the data is coming from SQL. In SQL you can use following to add new line to end of string

Select Col1, Col2, Col3 + Char(10) + Char(13) As Col3 From ...
0
 
LVL 7

Expert Comment

by:Element1910
ID: 38728376
Well, it looked like the data was coming from a DataTable from another page and put into a session variable or querystring to pass to this page. So that's why I mentioned tacking on the Environment.Newline to the variable or querystring that was being passed in.
0
 

Author Comment

by:zachvaldez
ID: 38741939
2 issues,
1.when I do the Add it adds the textbox but retains the information that loads on page_load event.
Is it possible that when it adds a new textbox , it is blank.

2. when I start to type with a number say 1992,1998 , there is is no ","
at the start of line however when I type text, it adds the "," in a new line though...
0
 

Author Closing Comment

by:zachvaldez
ID: 38815382
the comments helped in finding a solution.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question