Textbox on ticket reply not displaying multiple lines - asp.net

My ticketing system has a textbox for users to enter text and create/reply to a ticket. Currently when they enter multiple lines of text, once submitted, it will display as one line instead of two lines. We are storing all of the data in sql database and when displaying the responses they are showing as one line.
How can I get the value submitted to store in the database with multiline and then display back on the page with multiline when it pulls it from the database.
Thanks!

When reading the string from the database in the code behind, I had to use String.Replace(Environment.NewLine, "<br>")

Related

MS Access autocorrects html and displays p< as p<> in plain text memo field

Users enter statistical data into a MS Access database memo field that contains examples like this (p<0.001). For some reason Access displays this in the form or report as (p><0.001). It doesn't happen for the first example of p< in a memo field - only on the subsequent instances. This also causes any text after the final > not to be displayed on reports.
From what I can tell it is doing some strange autocorrect of html by attempting to complete the <p>!
Interestingly the data in the underlying table is correct. The field is formatted as plain text.
Does anyone have any thoughts on how to prevent this?
Thanks.

Using a text box to return a value

I would like to return the value from a control which is coming from a table of which it's field is linked to another table.
The control which i would like to install will be inserted on the mail form 'frmValueChain16' but will source the control 'contact' which is a control located on sub form 'frmValueChain16' and is directly linked to a multiple table query that i built to feed the subform.
My text box instead of returning the text value of the name of the contact (the field which i am trying to call) is returning the contact's unique ID number.
Below is what i have so far.
=[frmValueChain16].[Form]([contact].[Text])

Memo Username and Date stamp

I am new to Access and programing codes. I am building a data base where daily notes for issues can be kept. I want the end user to be able to view past records and make updates. However I do not want the to alter text previously put in the memo field containing the issue they are wanting to update. Also I am wanting to flag there new input with username and date/time.
I am try to accomplish this by inserting the following code into the AfterUpdate()
Private Sub Text0_AfterUpdate()
Me.Text0 = Me.Text0.Value & " " & UserName() & " # " & Now()
End Sub
I used Text0 because I am testing this code. Anyway this works in an unbound text box perfectly for flagging the new input. However when I try using this in my form with bound textboxes it fails to work. Any ideas? If I get this working I want to find a way to prevent editing on previously entered text but that is not a must.
The form containing the memo textbox for update was corrupt. By copying and pasting to create a new form with everything but the textbox I was having problems with I fixed my problem. I just made a new text box in the new form.

Why doesn't the detailsview control display the new line characters on the web page?

In SQL server 2008 R2, I have a table with column containing nvarchar(max) data. When I print the value from this column for one record it displays like this.
Using VS2010, I have developed ASP.net web form with DetailsView, which shows above record as shown below. The line carriage and new line characters are lost while displaying on DetailsView !! Question is how can I view new lines?
You need to replace newline character \n in the data field with HTML line break <br /> to display the text correctly on a web page.
You can replace the characters in the database query or stored procedure before returning the data to the presentation layer.
You can replace the characters while binding the data to the control in the presentation layer.
You might also want to use a fixed-width font if you want the data to align correctly.
Following link might help you with that.
How to do Replace("\n", "<br />") in detailsview BoundField data control
Solved by using pre (preserve)
pre style="text-overflow: visible;white-space: pre-wrap

Display data from database using selected value from combo list.. (ASP)

Does anyone know how to retrieve and display data from database using combo list? What I mean is this..I have a form..in the form there is a combo list and two textfiels..the user need to choose their company using that combo list..once they have chose their company, the address and contact number of the company will be display in the next two textfields called CAddress and CContact..for example, if the user chose company ABC..how can I display the company ABC address and contact number in those textfields? Need help. Thanks.
first of all you could use javascript and make a call ajax to an asp page passing the id of the company ... in that page you can jsut response.write the infos u need as a xml format ... even csv format would work ... then jsut take the response and write it in the textbox

Resources