Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Insert Plain HTML Code in ASP.NET page

Insert Plain HTML Code in ASP.NET page

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-nethelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Kirstenpfad
    wrote on last edited by
    #1

    HiHo i need to insert Plain HTML Code into my ASP.NET WebForm... well: I got several objects like textbox, buttons and so on... but after that, at a specific location in the html-source i need to insert dynamically generated HTML-Source. Who of you can help me out mfG. Daniel Kirstenpfad

    T 1 Reply Last reply
    0
    • D Daniel Kirstenpfad

      HiHo i need to insert Plain HTML Code into my ASP.NET WebForm... well: I got several objects like textbox, buttons and so on... but after that, at a specific location in the html-source i need to insert dynamically generated HTML-Source. Who of you can help me out mfG. Daniel Kirstenpfad

      T Offline
      T Offline
      Tom Welch
      wrote on last edited by
      #2

      You can use <asp:placeholder id="myPlaceHolder" runat="server" /> Then in your code (C# here): myPlaceHolder.Controls.Add(new LiteralControl("<b>Dynamic Stuff</b>")); --
      If it starts to make sense, you're in a cult.

      D 1 Reply Last reply
      0
      • T Tom Welch

        You can use <asp:placeholder id="myPlaceHolder" runat="server" /> Then in your code (C# here): myPlaceHolder.Controls.Add(new LiteralControl("<b>Dynamic Stuff</b>")); --
        If it starts to make sense, you're in a cult.

        D Offline
        D Offline
        Daniel Kirstenpfad
        wrote on last edited by
        #3

        Thanks mate... that did exactly what i was looking for... at least the literal control does not show up in the toolbox... even not in vs2003 mfG. Daniel Kirstenpfad

        T 1 Reply Last reply
        0
        • D Daniel Kirstenpfad

          Thanks mate... that did exactly what i was looking for... at least the literal control does not show up in the toolbox... even not in vs2003 mfG. Daniel Kirstenpfad

          T Offline
          T Offline
          Tom Welch
          wrote on last edited by
          #4

          Hey, you're welcome. Also, in case the documentation wasn't clear, you don't have to create a new LiteralControl for each html tag you add. You can create a whole page in a StringBuilder or string object and add it all in one go.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups