Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:37:33+00:00 2026-05-30T16:37:33+00:00

I have a ASP dynamic scaffolding project in which I am customizing a details

  • 0

I have a ASP dynamic scaffolding project in which I am customizing a details view. In my data source I have a few fields containing HTML and I would like to display the rendered HTML on the page rather then the source HTML as it is currently doing. The control looks like this.

<tr>
  <td class="DDLightHeader">
     <asp:Label ID="lblStatementHtml" runat="server" Text="Statement" />
  </td>
  <td>
     <asp:DynamicControl ID="dcStatementHtml" runat="server" DataField="StatementHtml"  />
  </td>
</tr>

I am confused on how to proceed since the default view for this control is the Text.ascx which is apparently nothing more then a literal (the same base control I use to render the HTML on my site. I am comfortable with creating a new FieldTemplate to render the HTML, but how can I force the html to render rather then display its source view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:37:34+00:00Added an answer on May 30, 2026 at 4:37 pm

    To resolve the above issue I had to create anew FieldTemplate

    HTML.ascx

    <%@ Control Language="C#" CodeBehind="HTML.ascx.cs" Inherits="ProductDynamicCMS.HTML" %>
    
    <asp:Literal runat="server" ID="Literal1" />
    

    HTML.cs

    using System;
    using System.Web.DynamicData;
    using System.Web.UI;
    
    namespace ProductDynamicCMS
    {
        public partial class HTML : FieldTemplateUserControl
        {
            protected override void OnDataBinding(EventArgs e)
            {
                base.OnDataBinding(e);
    
                object val = FieldValue;
                if (val != null)
                    Literal1.Text = val.ToString();
            }
    
            public override Control DataControl
            {
                get
                {
                    return Literal1;
                }
            }
    
        }
    }
    

    Then applied the UIHint for this class to the field display in the details view template.

    <tr>
      <td class="DDLightHeader">
         <asp:Label ID="lblStatementHtml" runat="server" Text="Statement" />
      </td>
      <td>
         <asp:DynamicControl ID="dcStatementHtml" runat="server" DataField="StatementHtml" UIHint="HTML"  />
      </td>
    </tr>
    

    And all was well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I am using ASP.NET Dynamic Data for a project and I have a table
In an ASP.NET Dynamic Data web site/project, all the templates have CSS classes like
I have an ASP.NET dynamic data site and for one of the text fields
I have an asp.net view/page (dynamic) that is built up of nested Html.RenderPartials. The
Here's the scenario: I have an asp.net webpage which displays dynamic data in a
I have an ASP.NET Dynamic Data web application, with an entity called ActivationResource .
I have come to the conclusion that the very nifty ASP.NET Dynamic Data framework
I've been looking into ASP.NET Dynamic Data and how it does scaffolding and routing.
I have an ASP.NET Dynamic Data application that includes two tables, Departments and KPI's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.