Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Gridview Update Strips Carriage Returns CHAR(13)

Posted on 2011-03-22
5
Medium Priority
?
1,037 Views
Last Modified: 2012-05-11
Hi All,

I am using a Gridview Control. I edit a record which uses a text box, when I save it it seems to strip out any carriage returns (CHAR(13)) that were there before.

I am simply using an Gridview and SQLDataSource Update command and the text box contains NVARCHAR data.

Interesting, when I first add this record using a web form, I use a similar multi line textbox and it preserves any carriage returns that are added.

Any ideas at all?

Thanks,

Rit
0
Comment
Question by:rito1
[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
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35191010
How do you test it?  In other words how do you know it is that character that is being stripped out at the save operation?
0
 
LVL 1

Author Comment

by:rito1
ID: 35191131
As soon as I have inserted a new record which preserves the carriage returns I then test the record by returning the data using the following SQL...

SELECT

REPLACE(PageDesc, CHAR(13), '<br />') AS PageDescHTML

FROM MyTable

Where ID = 50

After updating the same record within my Gridview control and run the same SQL, there are no '<br />' tags being replaced.

Thanks,

Rit
0
 
LVL 1

Accepted Solution

by:
rito1 earned 0 total points
ID: 35239659
Hi AndyAinscow, strangely it was to do with the style tag I had applied to the Textbox which was causing it to ignore the line break.

Rit
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35239669
Wierd, glad to hear you got it sorted out.
0
 
LVL 1

Author Closing Comment

by:rito1
ID: 35356734
The issue was related to CSS rather than Gridview binding.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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