fusioninternet
asked on
HTML from database changed into text
Hi Experts,
I having trouble displaying some HTML on a page which is being read from an SQL database.
I've followed the introduction to MVC 3 here http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs which uses EFCodeFirst for the data connection. All is fine and now I'm using TinyMCE to format the text being saved. Which is also wokring fine as when I look into teh database the text is formatted in HTML.
My problem occurs when I display the desired field on another page. Instead of the text displaying formatted HTML, i get the text HTML code dispalyed instead.
eg. <strong>Hello World</strong> is displayed as <strong>Hello World</strong> instead of bold "Hello World"
When looking at the source code it read back as:-
<strong>Hello World</strong>
I'm displaying the field as simple as possible using just <%: Model.main_text %>
Any help on how to get this to display is greatly appreciated.
Steve
I having trouble displaying some HTML on a page which is being read from an SQL database.
I've followed the introduction to MVC 3 here http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs which uses EFCodeFirst for the data connection. All is fine and now I'm using TinyMCE to format the text being saved. Which is also wokring fine as when I look into teh database the text is formatted in HTML.
My problem occurs when I display the desired field on another page. Instead of the text displaying formatted HTML, i get the text HTML code dispalyed instead.
eg. <strong>Hello World</strong> is displayed as <strong>Hello World</strong> instead of bold "Hello World"
When looking at the source code it read back as:-
<strong>Hello World</strong>
I'm displaying the field as simple as possible using just <%: Model.main_text %>
Any help on how to get this to display is greatly appreciated.
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check the character encoding used by your SQL it should be a charset that can be displayed by your browser.
ASKER
That did the trick.
Thanks very much.
Thanks very much.