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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to clear HTML tables created at run time...

How to clear HTML tables created at run time...

Scheduled Pinned Locked Moved ASP.NET
htmldatabasehelptutorial
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.
  • B Offline
    B Offline
    Balagurunathan S
    wrote on last edited by
    #1

    Hi friends.. I manually code to get tables holding values returned from database in an .aspx page.Now i need to clear those tables when i click the clear button which i have in my page..how to to it..someone help in this regard.. Regards,

    Balaguru

    D 1 Reply Last reply
    0
    • B Balagurunathan S

      Hi friends.. I manually code to get tables holding values returned from database in an .aspx page.Now i need to clear those tables when i click the clear button which i have in my page..how to to it..someone help in this regard.. Regards,

      Balaguru

      D Offline
      D Offline
      Declan Bright
      wrote on last edited by
      #2

      I'm not sure at what level you are manually coding to "get tables holding values" but if you are databinding a control to a datasource you can clear that control by binding to a null value. If you are dynamically writing out HTML to the page then you should write it out to a Literal control and to clear it, you can assign it an empty string.

      Declan Bright www.declanbright.com

      B 1 Reply Last reply
      0
      • D Declan Bright

        I'm not sure at what level you are manually coding to "get tables holding values" but if you are databinding a control to a datasource you can clear that control by binding to a null value. If you are dynamically writing out HTML to the page then you should write it out to a Literal control and to clear it, you can assign it an empty string.

        Declan Bright www.declanbright.com

        B Offline
        B Offline
        Balagurunathan S
        wrote on last edited by
        #3

        Dear Bright.. How to write the HTML to a literal control and clear it..? Can u just give me some sample code to do that..? Thanks & Regards,

        Balaguru

        D 1 Reply Last reply
        0
        • B Balagurunathan S

          Dear Bright.. How to write the HTML to a literal control and clear it..? Can u just give me some sample code to do that..? Thanks & Regards,

          Balaguru

          D Offline
          D Offline
          Declan Bright
          wrote on last edited by
          #4

          Create a literal control:

          <asp:Literal ID="Literal1" runat="server"></asp:Literal>

          Add some HTML:

          this.Literal1.Text = "... enter html here ...";

          Clear the HTML:

          this.Literal1.Text = string.Empty;

          Declan Bright www.declanbright.com

          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