Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I show a string as html content in web form

I am trying to retrieve a html document to show in my web page, now the content comes from database as a string. Now I know there is a way to do this in win forms using Browser.DocumentText. But how do I do this in web form?

I tried the setting the innerHTML property for a div inside of the "OnRowCommand", the "OnRowCommand" happens to be inside an update panel. When I move the Div outside the panel, say to just below the body, it renders well.

like image 775
Navyseal Avatar asked Nov 30 '11 07:11

Navyseal


2 Answers

Well there are many ways to do this, you can use a label, literal Controls.

Or maybe defining a public string within your page then use it directly in your html as:

<%= strSomeString %>
like image 193
Issa Qandil Avatar answered Nov 13 '22 08:11

Issa Qandil


Add a literal control in aspx file and in codebehind set

Literal1.Text=data_from_DB;

like image 30
Nitesh Avatar answered Nov 13 '22 09:11

Nitesh