Can some one please help I am using the fckeditor (Web-based HTML text editor) and saving its content to the database. This is saved as raw html. What I want to do is output the rendered html to
an asp.net page. How ever when I query the db and output the result. When the html is outputted it isn’t rendered. Does any know how to render the html text, Please help?????????????
I tryed that but the html I want to render contains large tables and the Literal control cant read it. Any other suggestions? Do I need to encode it or something???
I know this poster is long gone, and it took me a helluva time to even find this problem online (if you type "render html asp.net" you get many many different results)
but I have the solution.
the source HTML, when put into the database, and pulled back out, turns "<" and ">" and " " " into
>
<
"
so when you bring it back out (if you are using a data grid, you would usethe
RowDataBound event, and use e.row.cells[index].text) you would need to do a
hedigan
Member
2 Points
12 Posts
render html source code
Mar 27, 2008 11:06 PM|LINK
Can some one please help I am using the fckeditor (Web-based HTML text editor) and saving its content to the database. This is saved as raw html. What I want to do is output the rendered html to an asp.net page. How ever when I query the db and output the result. When the html is outputted it isn’t rendered. Does any know how to render the html text, Please help?????????????
[8-)]
pnv.ravikira...
Participant
1164 Points
227 Posts
Re: render html source code
Mar 28, 2008 02:49 AM|LINK
Hi,
To render HTML, you can use literal control just find below example
Literal1.Text = <HTML source code as string>
Happy Coding
</div>Please mark as “Answer” if you find this post helpful
Happy coding..
-------------------------------------------------------------------
Please mark as answer if you find this post helpful.
hedigan
Member
2 Points
12 Posts
Re: render html source code
Mar 28, 2008 09:25 AM|LINK
pnv.ravikira...
Participant
1164 Points
227 Posts
Re: render html source code
Mar 30, 2008 10:39 PM|LINK
Hi,
As per my knowledge it doesn't matter how big tables you have in the HTML string, Literal control will render HTML text.
Happy coding..
-------------------------------------------------------------------
Please mark as answer if you find this post helpful.
roger_27
Member
14 Points
24 Posts
Re: render html source code
Mar 31, 2010 05:29 PM|LINK
I know this poster is long gone, and it took me a helluva time to even find this problem online (if you type "render html asp.net" you get many many different results)
but I have the solution.
the source HTML, when put into the database, and pulled back out, turns "<" and ">" and " " " into
>
<
"
so when you bring it back out (if you are using a data grid, you would usethe
RowDataBound event, and use e.row.cells[index].text) you would need to do a
.Replace(
""","\"").Replace(">",">").Replace("<","<")
on the literal text.