Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

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


  • Please log in to reply

#1
Immortalarena

Immortalarena

    Member

  • Member
  • PipPipPip
  • 216 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
  • 216 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