How to display data in a Div using Innerhtml property from database?

Posted by Raj.Trivedi under ASP.NET on 6/18/2012 | Points: 10 | Views : 5356 | Status : [Member] [MVP] | Replies : 1
Hello Team,

I am using a AJAX HTML EDITOR to save the data in database in HTML format

EG : - Using HTML EDITOR i wrote Hello World and made it bold and inserted into database.
In database it is stored as Hello World with Bold tag

Now i want to fetch the data from database display it in the div with the same formatting.

I created a Private function to fill the div

Please find the Below Function

private void FillDIV()
DataSet ds = new DataSet();
ds = objdal.getData(); // this is another public function which fetches the data from database.
DataDiv.InnerHtml = ds.Tables[0].Rows[0]["HTMLDATA"].ToString();

catch(Exception ex )
lblErr.Text = ex.Message;
lblErr.Visible = true;

I am getting the data in the dataset as Hello World with the Bold tag wrapped around it and to display it i use innerhtml property of div
and on page load i have called the function but i do not get the Display
I do not know what is happening

"Sharing is Caring"
Please mark as answer if your Query is resolved


Posted by: Ajay.Kalol on: 6/19/2012 [Member] Starter | Points: 25

Can you Post full code and HTML of your Page???


Raj.Trivedi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response