datagrid - display HTML, don't render (VB)

Discussion in 'ASP .Net' started by The Colonel, Jan 16, 2005.

  1. The Colonel

    The Colonel Guest

    I have a database of our company's HTML email templates - name,
    subject, etc. Well, some are for HTML emails, and the template_text
    column contains HTML. When I display in a datagrid, it REALLY screws
    with the formatting, not to mention the INSERT and UPDATE statements.
    How can I best display HTML as text in a datagrid?
    The Colonel, Jan 16, 2005
    1. Advertisements

  2. The Colonel

    David Jessee Guest

    In the Datadrid Designer, turn your column into a template column
    Then, in your aspx file, change the databinding on the resultant Label to

    Text='<%# Server.HtmlEncode(Databinder.Eval(.....))%>'
    David Jessee, Jan 16, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.