C# - Web App: How to get DesignTimeHTML() from a web control loaded with LoadControl?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • psc1973
    New Member
    • Nov 2007
    • 2

    C# - Web App: How to get DesignTimeHTML() from a web control loaded with LoadControl?

    Hi, I think the title says it all but basically I want to get the HTML the designer would retrieve using GetDesignTimeHT ML() but can't work out how to get to it. The control is loaded dynamically using LoadControl,

    eg.

    Control c = Page.LoadContro l("Controls/Test1.ascx");
    ViewRendering vr =ControlDesigne r.GetViewRender ing(c);

    TIA.
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by psc1973
    Hi, I think the title says it all but basically I want to get the HTML the designer would retrieve using GetDesignTimeHT ML() but can't work out how to get to it. The control is loaded dynamically using LoadControl,

    eg.

    Control c = Page.LoadContro l("Controls/Test1.ascx");
    ViewRendering vr =ControlDesigne r.GetViewRender ing(c);

    TIA.
    Try using the control's ClientID property.
    Eg
    c.ClientID should return the string of the name for the control

    Comment

    • psc1973
      New Member
      • Nov 2007
      • 2

      #3
      Originally posted by Frinavale
      Try using the control's ClientID property.
      Eg
      c.ClientID should return the string of the name for the control
      Sorry, I think you misunderstand. I am trying to get the design time HTML of the control, this is the HTML used in the IDE to represent the control at design time.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by psc1973
        Sorry, I think you misunderstand. I am trying to get the design time HTML of the control, this is the HTML used in the IDE to represent the control at design time.
        You're right, I miss read the question. I didn't realize you were working with Design Time...most people usually work with Run Time problems.

        Could you please explain what exactly you are trying to do?

        Comment

        Working...