Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Display Encoded HTML in GridviewDisplay Encoded HTML in Gridview
Previous
 
Next
New Post
7/24/2007 5:19 AM
 

Hopefully this will be an easy one, I have created many modules and deployed them without problems. I have just have the need to use the built in TextEditor Control and have come across a problem.

I have successfully added the control to my ascx page and then saved the encoded html produced by the texteditor into my database.

 

The problem arrises when I try to then display the results in say a gridview cell, all I get is encoded or de encoded html text depending on the selection I make in the Edit Columns... menu of the gridview and not the items it represents.

When I view the html page source all I see is the encoded text from the database. i.e "<p><img width="59" height="75" src="/Dnn_454/Portals/0/book_wrox2.jpg" alt="" /></p>"

instead of " <p><img width="59" height="75" src="/Dnn_454/Portals/0/book_wrox2.jpg" alt="" /></p>"

I have been staring at this problem for a few days now, am I missing something silly here, any pointers would be gratefully appreciated.

 

 

 
New Post
7/24/2007 9:23 AM
 

If you are using a bound field try playing with the HtmlEncode="true/false" property.

If not, you can handle this in the RowCommand event.

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcreated(VS.80).aspx

 

 
New Post
7/25/2007 7:21 AM
 

Hi Thanks for you help but I am struggling to understand the conept.

Whether I htmlencode in the vb code behind on bind or in the IDE menu I get the same result = text written on page only.

As I said in the original post, I can encode and de encode the html  and I then see either "&lt;p&gt;"   or "<p> shown as text on the webpage.

My problem is that I cannot send this to the browser as html, it is as if the processing is being done too late. All I see on the webpage is text.

 

For instance I have embedded the TextEditor into my module and have added one of the standard dnn images to a ntext field in the database. i.e

which ever way (enocode or de encode)  try to display this field in a web control on my page all I get is <img width="100" height="89" src="/Portals/25/DNNReview/Sample Verification Page.png" alt="" /> or the encoded version of this text.

The html isnt being rendered for some reason?

Sorry if this is a real dim question but I have gone code blind now from staring at the problem too long. I am obviously missing a simple part of the process.

 

 
New Post
7/25/2007 12:46 PM
 

This may be a silly question, but have you tried it without the encode/decode function?  It seems like ifyou are using a the dnn text editor and a gridview, this should happen automatically without the need to call any additional functions.

 
New Post
7/25/2007 1:13 PM
 

I have used the TextEditor and loaded the resulting data as a literal control like :

 Me.celContent.Controls.Add(New System.Web.UI.LiteralControl(Server.HtmlDecode(ctlText.ToString)))

I probably originally figured this out by digging into the html/text module.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Display Encoded HTML in GridviewDisplay Encoded HTML in Gridview


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out