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

  • SEARCH
  • Home
  • 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 594797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:59:32+00:00 2026-05-13T15:59:32+00:00

using C# I am saving formated HTML data in MSSQL such as: <div>\n\t<p>x</p>\n</div> I

  • 0

using C# I am saving formated HTML data in MSSQL such as:

<div>\n\t<p>x</p>\n</div>

I am than populating it into a textarea to display. I understand that I can use the .value property of the element to pull all of the ASCII characters out of the textarea, however, I can’t seem to figure out how to get the "\n" and "\t" characters to show up as new lines and tabs.

When I use FireBug to check the html contents of the textarea in question, this is what is displayed:

&lt;div&gt;/\n/\t&lt;p&gt;This is a test Div&lt;/p&gt;/\n&lt;/div&gt;

I don’t really care about using JavaScript to display the new lines and tabs, I can also use .NET to change the characters, I would just like to know either or both options.

Thanks much!

  • 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-05-13T15:59:32+00:00Added an answer on May 13, 2026 at 3:59 pm

    In .NET you can use String.Replace:

    s = s.Replace(@"\n", "\n");
    s = s.Replace(@"\t", "\t");
    

    You might want to consider whether you should make this replacement before you insert the data into the database rather than as you fetch it, because you’ll probably only be inserting it once but fetching it a lot of times.

    On the other hand, if you do it on the client then the work is offloaded from the server. But if they don’t have Javascript enabled, it will look wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After saving a String value into memcached using the Danga client, I attempted to
Using OpenCV, saving a CvMat structure into a YAML file on the disk is
OK, I have txt files that I am parsing and saving into a sql
I have been thinking of saving data using dictionaries and arrays etc. Would it
Am saving to a mysql table using: $query = mysql_query(INSERT INTO test SET postit='$postit',postdate=NOW());
Possible Duplicate: Core Data vs SQLite 3 I have been using SQLite for saving
Possible Duplicate: Issue while saving image using savefiledialog I use windows forms in C#.
I am saving some emails on my local machine using MailBee.NET Objects in htm
I am saving an XMLDocument object to disk using the Save (string) function .
Using MSXML4, I am creating and saving an xml file: MSXML2::IXMLDOMDocument2Ptr m_pXmlDoc; //add some

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.