Solved

Display HTML tags from database in GridView

Posted on 2006-06-15
4
1,659 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

635 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