Solved

Display HTML tags from database in GridView

Posted on 2006-06-15
4
1,656 Views
Last Modified: 2011-10-03
Does anyone know how I can display the html in the data within my bound GridView control? Right now the gridview is automatcally using HtmlEncode and showinig the html tags.
0
Comment
Question by:HangTenDesign
4 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 16912669
Have you tried this?

<asp:templatefield>
  <itemtemplate>
    <%# Bind("myDBfieldWithHTML") %>
  </itemtemplate>
</asp:templatefield>
0
 

Author Comment

by:HangTenDesign
ID: 16914391
Yes, I'm using bound data. I'm also creating the columns on the fly. But this is what I found elsewhere on the web to solve the problem:

----------------------------------

                       bf = new BoundField();
                        bf.HeaderText = reader["field_name"].ToString();
                        bf.DataField = reader["field_id"].ToString();
                        bf.SortExpression = reader["field_order"].ToString();
                        bf.HeaderStyle.Wrap = false;
                        bf.HtmlEncode = false;  //This is the line that solved the problem.
                        ChecklistView.Columns.Add(bf);

----------------------------------

HtmlEncode = false; //This is the line that solved the problem.

0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 17141488
PAQed with points refunded (250)

CetusMOD
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question