Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9145963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:38:36+00:00 2026-06-17T10:38:36+00:00

In vb.net I have a DataTable that I am adding content to. One column

  • 0

In vb.net I have a DataTable that I am adding content to. One column contains a free text field so I want to show the new lines as new lines on the page. I did this:

For Each row As DataRow In dtEmails.Rows
    Dim newBody As String = row.Item("body").ToString.Replace(vbCrLf, "<br>")
    row.Item("body") = newBody
Next

But the cells now just show literal HTML like Line<br>Line. One forum thread I found suggested calling Server.HtmlDecode on the string but that doesn’t work. Is there another way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:38:37+00:00Added an answer on June 17, 2026 at 10:38 am

    I found an answer to this – calling Server.HtmlDecode as each row is bound.

    Protected Sub myGridView_RowDataBound(ByVal o As Object, ByVal e As GridViewRowEventArgs) Handles gvEmails.RowDataBound
        Dim cell As String = e.Row.Cells(8).Text.Replace(vbCrLf, "<br>")
        e.Row.Cells(8).Text = Server.HtmlDecode(cell)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Datatable that contains a column that I want to use for
Suppose I have an ADO.NET DataTable that I was to 'persist' by saving it
I have the data table from the jquery plugin dataTables (http://datatables.net/) that I want
I have datatable in vb.net 2008 has 40000 rows. i want to delete 1000
I'm having a small trouble with ASP.net. I have a small DataTable that i
I have a .net/ c# console app with a DataTable that I populated from
I want to make sure that 2 Ado.net datatables have the same schema: number
Using .NET 1.1, I have a DataGrid that contains three columns for each row.
I am working with VB.NET.. i have a DataTable called QUESTION, containing 3 fields:
EDIT: I am using VS2008, .NET 3.5 I have a DataTable, which is populated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.