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. Hi solve this html problem in dynamic control creation

Hi solve this html problem in dynamic control creation

Scheduled Pinned Locked Moved ASP.NET
helphtmldesignquestion
11 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.
  • N Offline
    N Offline
    navinkumar4
    wrote on last edited by
    #1

    Hi, My requirement is to provide tetboxes based on number selected in dropdownlist.I created instances of textboxes but while formatting it to html i m facing problem. I need to display the textboxes before a button which is given directly in design mode. while running the form, i find the textboxes coming after the button. How can i make them to align as per my req. I also need them to align to center. Please help me.I am stuck up with this problem for last few hours. :(:confused::sigh:

    M H V 3 Replies Last reply
    0
    • N navinkumar4

      Hi, My requirement is to provide tetboxes based on number selected in dropdownlist.I created instances of textboxes but while formatting it to html i m facing problem. I need to display the textboxes before a button which is given directly in design mode. while running the form, i find the textboxes coming after the button. How can i make them to align as per my req. I also need them to align to center. Please help me.I am stuck up with this problem for last few hours. :(:confused::sigh:

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      The simple way to place the dynamic textboxes before the button is that you place a container like Panel, PlaceHolder ... before the button, you then add the dynamic textboxes to the container.

      N 1 Reply Last reply
      0
      • N navinkumar4

        Hi, My requirement is to provide tetboxes based on number selected in dropdownlist.I created instances of textboxes but while formatting it to html i m facing problem. I need to display the textboxes before a button which is given directly in design mode. while running the form, i find the textboxes coming after the button. How can i make them to align as per my req. I also need them to align to center. Please help me.I am stuck up with this problem for last few hours. :(:confused::sigh:

        H Offline
        H Offline
        HimaBindu Vejella
        wrote on last edited by
        #3

        Place the controls in a Panel will serve the purpose "Aim to go where U have never been B4 and Strive to achieve it" http://groups.yahoo.com/subscribe/dotnetforfreshers http://himabinduvejella.blogspot.com

        N 1 Reply Last reply
        0
        • N navinkumar4

          Hi, My requirement is to provide tetboxes based on number selected in dropdownlist.I created instances of textboxes but while formatting it to html i m facing problem. I need to display the textboxes before a button which is given directly in design mode. while running the form, i find the textboxes coming after the button. How can i make them to align as per my req. I also need them to align to center. Please help me.I am stuck up with this problem for last few hours. :(:confused::sigh:

          V Offline
          V Offline
          VMSSanthosh
          wrote on last edited by
          #4

          place a panel control before the button.. add the textboxes to that panel ur problem will be solved VMSSanthosh

          N 1 Reply Last reply
          0
          • H HimaBindu Vejella

            Place the controls in a Panel will serve the purpose "Aim to go where U have never been B4 and Strive to achieve it" http://groups.yahoo.com/subscribe/dotnetforfreshers http://himabinduvejella.blogspot.com

            N Offline
            N Offline
            navinkumar4
            wrote on last edited by
            #5

            Hi, Thanks for ur answer. i cant understand where to place this panel can u please help me with some coding or reference links How to place the panel in my backend code, and how to insert the controls dynamically added to that panel. I m a bit confused over that.. Help me please..

            1 Reply Last reply
            0
            • M minhpc_bk

              The simple way to place the dynamic textboxes before the button is that you place a container like Panel, PlaceHolder ... before the button, you then add the dynamic textboxes to the container.

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

              Hi, Thanks for ur answer. i cant understand where to place this panel can u please help me with some coding or reference links How to place the panel in my backend code, and how to insert the controls dynamically added to that panel. I m a bit confused over that.. Help me please..

              1 Reply Last reply
              0
              • V VMSSanthosh

                place a panel control before the button.. add the textboxes to that panel ur problem will be solved VMSSanthosh

                N Offline
                N Offline
                navinkumar4
                wrote on last edited by
                #7

                Hi, Thanks for ur answer. i cant understand where to place this panel can u please help me with some coding or reference links How to place the panel in my backend code, and how to insert the controls dynamically added to that panel. I m a bit confused over that.. Help me please..

                T 1 Reply Last reply
                0
                • N navinkumar4

                  Hi, Thanks for ur answer. i cant understand where to place this panel can u please help me with some coding or reference links How to place the panel in my backend code, and how to insert the controls dynamically added to that panel. I m a bit confused over that.. Help me please..

                  T Offline
                  T Offline
                  Tuwing Sabado
                  wrote on last edited by
                  #8

                  You don't need to add the panel dynamically just drag-it from the page then place it above the button. On page_load add this code.

                  TextBox dynamicTextbox1 = new TextBox();
                  Panel1.Controls.Add(dynamicTextbox1);

                  N 2 Replies Last reply
                  0
                  • T Tuwing Sabado

                    You don't need to add the panel dynamically just drag-it from the page then place it above the button. On page_load add this code.

                    TextBox dynamicTextbox1 = new TextBox();
                    Panel1.Controls.Add(dynamicTextbox1);

                    N Offline
                    N Offline
                    navinkumar4
                    wrote on last edited by
                    #9

                    Hi, Thanks for ur answer, I solved my problem. :cool:

                    1 Reply Last reply
                    0
                    • T Tuwing Sabado

                      You don't need to add the panel dynamically just drag-it from the page then place it above the button. On page_load add this code.

                      TextBox dynamicTextbox1 = new TextBox();
                      Panel1.Controls.Add(dynamicTextbox1);

                      N Offline
                      N Offline
                      navinkumar4
                      wrote on last edited by
                      #10

                      Hi, i want to access the controls created dynamically, in the codebehind (ie., before its creation).I want to insert the radiobutton values into database. i cant access the controls before its creation.I am creating a some radio buttons depending on the dropdown. I tried a radiobuttonlist adding it in design time.but could not get the answer. How can i do this?

                      T 1 Reply Last reply
                      0
                      • N navinkumar4

                        Hi, i want to access the controls created dynamically, in the codebehind (ie., before its creation).I want to insert the radiobutton values into database. i cant access the controls before its creation.I am creating a some radio buttons depending on the dropdown. I tried a radiobuttonlist adding it in design time.but could not get the answer. How can i do this?

                        T Offline
                        T Offline
                        Tuwing Sabado
                        wrote on last edited by
                        #11

                        There are two solutions to your problem. 1. Iterate to your container "Panel" controls collection. //Page Load Event Handler protected void Page_Load(object sender, EventArgs e) { RadioButton radioButton = new RadioButton(); radioButton.ID = "MyRadioButton"; Panel1.Controls.Add(radioButton); } //Button Click Event Handler protected void GetMyRadioButton_Click(object sender, EventArgs e) { // Code on how to access the controls from your panel. for (Int16 i = 0; i < Panel1.Controls.Count;i++ ) { if (Panel1.Controls[i].GetType().Name == "RadioButton") { RadioButton radioButton = (RadioButton)Panel1.Controls[i]; if (radioButton.ID == "MyRadioButton") { //Put your code here } } } } 2. Use the Panel FindControl Method.
                        //Page Load Event Handler protected void Page_Load(object sender, EventArgs e) { RadioButton radioButton = new RadioButton(); radioButton.ID = "MyRadioButton"; Panel1.Controls.Add(radioButton); } //Button Click Event Handler protected void GetMyRadioButton_Click(object sender, EventArgs e) { // Code on how to access the controls from your panel. RadioButton radioButton = (RadioButton)Panel1.FindControl("MyRadioButton"); //Put your code here }

                        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