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. Div Object

Div Object

Scheduled Pinned Locked Moved Web Development
htmlcomquestion
8 Posts 5 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.
  • L Offline
    L Offline
    L Viljoen
    wrote on last edited by
    #1

    Hi to all I would like to declare a html div object in the code behind of my aspx page, I knwo that the declaration of a image is HTMLImage image = new Image but what is the code for a div. Thanx in advance.

    Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

    T V R 3 Replies Last reply
    0
    • L L Viljoen

      Hi to all I would like to declare a html div object in the code behind of my aspx page, I knwo that the declaration of a image is HTMLImage image = new Image but what is the code for a div. Thanx in advance.

      Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      With div as runat="server", you can use HtmlGenericControl for DIV.

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      L 1 Reply Last reply
      0
      • L L Viljoen

        Hi to all I would like to declare a html div object in the code behind of my aspx page, I knwo that the declaration of a image is HTMLImage image = new Image but what is the code for a div. Thanx in advance.

        Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

        T Offline
        T Offline
        Tamimi Code
        wrote on last edited by
        #3

        in your html code.. <div id="myDiv" runat="server">anything</div> then you can access this div through its id

        When you get mad...THINK twice that the only advice Tamimi - Code

        L 1 Reply Last reply
        0
        • V Vasudevan Deepak Kumar

          With div as runat="server", you can use HtmlGenericControl for DIV.

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          L Offline
          L Offline
          L Viljoen
          wrote on last edited by
          #4

          Seems to work, thank you

          Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

          1 Reply Last reply
          0
          • T Tamimi Code

            in your html code.. <div id="myDiv" runat="server">anything</div> then you can access this div through its id

            When you get mad...THINK twice that the only advice Tamimi - Code

            L Offline
            L Offline
            L Viljoen
            wrote on last edited by
            #5

            Yes I know that, But I would like to declare a div object in the code behind, not something that is initialised in the aspx code.

            Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

            N 1 Reply Last reply
            0
            • L L Viljoen

              Yes I know that, But I would like to declare a div object in the code behind, not something that is initialised in the aspx code.

              Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

              N Offline
              N Offline
              NetRams
              wrote on last edited by
              #6

              You can do with in create one td with runat='server' and id. Using that id add div as string to that.

              In code behind add as, mytd.innethtml = "

              .......

              " You can try this.

              Be simple and Be sample.

              V 1 Reply Last reply
              0
              • N NetRams

                You can do with in create one td with runat='server' and id. Using that id add div as string to that.

                In code behind add as, mytd.innethtml = "

                .......

                " You can try this.

                Be simple and Be sample.

                V Offline
                V Offline
                Vasudevan Deepak Kumar
                wrote on last edited by
                #7

                ramskr wrote:

                mytd

                He was actually asking what type to declare mytd in the codebehind. Simplying further, protected ?????? mytd; What does ?????? stand for? In your case (example), it should be HtmlTableCell. If it is DIV, it should be HtmlGenericControl.

                Vasudevan Deepak Kumar Personal Homepage Tech Gossips

                1 Reply Last reply
                0
                • L L Viljoen

                  Hi to all I would like to declare a html div object in the code behind of my aspx page, I knwo that the declaration of a image is HTMLImage image = new Image but what is the code for a div. Thanx in advance.

                  Le Roux Viljoen Web Developer PCW New Media South African Branch www.pcwnewmedia.com

                  R Offline
                  R Offline
                  RichardGrimmer
                  wrote on last edited by
                  #8

                  I tend to use a Panel - they're rendered as DIVs anyway :) Panel p = new Panel();

                  "Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman" (Lilly Allen / Kaiser Chiefs)

                  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