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

ASP.NET

Scheduled Pinned Locked Moved Web Development
questioncsharpasp-nettutorial
7 Posts 3 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.
  • M Offline
    M Offline
    Mazdak
    wrote on last edited by
    #1

    How can I change the place of a control (for example textbox) in the page programmicaly? Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
    Wish You Were Here-Pink Floyd-1975

    O A 2 Replies Last reply
    0
    • M Mazdak

      How can I change the place of a control (for example textbox) in the page programmicaly? Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
      Wish You Were Here-Pink Floyd-1975

      O Offline
      O Offline
      omkamal
      wrote on last edited by
      #2

      If you are using ASP.NET TextBox control then *I believe* you can use its style property (I have not done that, yet). omkamal

      M 1 Reply Last reply
      0
      • O omkamal

        If you are using ASP.NET TextBox control then *I believe* you can use its style property (I have not done that, yet). omkamal

        M Offline
        M Offline
        Mazdak
        wrote on last edited by
        #3

        In web application when you put a control in one place then you can't change the place or size of it and all of them are fixed? Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
        Wish You Were Here-Pink Floyd-1975

        O 1 Reply Last reply
        0
        • M Mazdak

          In web application when you put a control in one place then you can't change the place or size of it and all of them are fixed? Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
          Wish You Were Here-Pink Floyd-1975

          O Offline
          O Offline
          omkamal
          wrote on last edited by
          #4

          Mazdak wrote: you can't change the place or size of it I dont think so. Just try to create an example like this... Create an . Then in your code-behind page you can always do the following... TestLabel.Style["Top"] = "200px"; //or whatever value you want to use... This will certainly work. Nonetheless, I am not sure about a TextBox. omkamal

          1 Reply Last reply
          0
          • M Mazdak

            How can I change the place of a control (for example textbox) in the page programmicaly? Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
            Wish You Were Here-Pink Floyd-1975

            A Offline
            A Offline
            Andy Smith
            wrote on last edited by
            #5

            Simply add the control to the Controls collection of a different control on the page.

            M 1 Reply Last reply
            0
            • A Andy Smith

              Simply add the control to the Controls collection of a different control on the page.

              M Offline
              M Offline
              Mazdak
              wrote on last edited by
              #6

              Andy Smith wrote: Simply add the control to the Controls collection of a different control on the page. Sorry could you be more specific?I didn't get it.:confused: Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
              Wish You Were Here-Pink Floyd-1975

              A 1 Reply Last reply
              0
              • M Mazdak

                Andy Smith wrote: Simply add the control to the Controls collection of a different control on the page. Sorry could you be more specific?I didn't get it.:confused: Mazy "So,so you think you can tell, Heaven from Hell, Blue skies from pain,... How I wish,how I wish you were here."
                Wish You Were Here-Pink Floyd-1975

                A Offline
                A Offline
                Andy Smith
                wrote on last edited by
                #7

                Well, I guess it depends on what you mean by "place of a control". If you mean moving it a few pixels to the left or right or something, then use the Left and Top properties. If you want the control to be in a different place in the page structure, then add your control to the Controls collection of a different, container control. A good one to use for this purpose is the PlaceHolder control. It would look something like this: TextBox myTextBox = new TextBox(); myPlaceHolder.Controls.Add( myTextBox );

                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