Last post Mar 15, 2009 09:19 PM by defiant1970
Mar 15, 2009 02:56 PM|defiant1970|LINK
I am using the FCKeditor and I saw it can create complete html code. I was wondering if anyone knew how to render this code as a control of sorts.
Right now I am using the editor to check for spelling then emter the data into a data base table. Is there a way (more then likely because I am not the first person to think of it) to render what is created by the editor (the html) to display the created
Mar 15, 2009 03:11 PM|.netdan|LINK
Sure, to render a block of HTML from code you can use the LiteralControl like this:
Controls.Add(new LiteralControl("<div>Some HTML</div>"));
The LiteralControl constructor takes a text string and simply drops the content onto the page.
Hope this is what you wanted!
Mar 15, 2009 03:46 PM|defiant1970|LINK
I looked at my post and I was not clear
I want to select the information from the data base table and render it to a page.
Mar 15, 2009 04:00 PM|.netdan|LINK
Ah, so the question is how to retrieve the HTML from a database table? Do you know which field in which table the HTML is stored? If it is stored as plain HTML in a table then it will be easy to retrieve.
An example method to retrieve the HTML for the database would be:
html = com.ExecuteScalar().ToString();
asp.net html database table
Mar 15, 2009 04:31 PM|defiant1970|LINK
what control do I bind the string html to?
I tried to bind it to a label control and I Have <p>Something<p> in the database and it returned -1
by the way thank you for helping me
Mar 15, 2009 09:19 PM|defiant1970|LINK
just for those who are looking at this post for answers I have figured out the solution. this took me all day to find it but this how you do it
thios is the code to reteive the code from the DB and to display the code
myCommand.CommandType = CommandType.StoredProcedure
parameterinformationID.Value = LetterID
parameterBody1.Direction = ParameterDirection.Output
parameterBody2.Direction = ParameterDirection.Output
parameterBody3.Direction = ParameterDirection.Output
Body1.Text = Server.HtmlDecode(Letter_Details.Body1)
this the code that allows stored HTML page data to rendered server.htmldecoder
Body2.Text = Server.HtmlDecode(Letter_Details.Body2)
Body3.Text = Server.HtmlDecode(Letter_Details.Body3)