Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

ASP.net C# - Pulling HTML from Database returns character:


  • Please log in to reply

#1
Immortalarena

Immortalarena

    Member

  • Member
  • PipPipPip
  • 211 posts
I'm learning ASP.net for a few weeks, and have begun converting my ASP classic sites to .net. I store the pages in an MSSQL database using CKEditor to generate the HTML.

When I pull the value in a classic record set it prints fine on the screen, but in ASP.net it's pulling the   values as "".

I'm storing the record in a DataTable, which is where I can see the result has the strange character.
pageTableAdapter tA = new pageTableAdapter();
DataTable dt = tA.GetPageByPageName(pageName);

Is there something I should adjust on my TableAdapter or DataTable to read the HTML correctly? I'm trying to store it in a String and write it to the page.

Any help or Advice is greatly appreciated.

Thanks!
  • 0

Advertisements


#2
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
It seems to be a character encoding issue. Try adding this to the <head> section:
<meta charset="utf-8">

Regards,

Ax
  • 0

#3
Immortalarena

Immortalarena

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 211 posts
I've tried the shorthand HTML 5 method you show as well as
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
with no change... very odd.
  • 0

#4
Ax238

Ax238

    Tech Staff

  • Technician
  • 1,323 posts
I still think there's an encoding issue, take a look here:
http://support.microsoft.com/kb/893663
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP