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. Dynamically create controls using AJAX

Dynamically create controls using AJAX

Scheduled Pinned Locked Moved ASP.NET
sysadminhelp
6 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.
  • A Offline
    A Offline
    alimohammed
    wrote on last edited by
    #1

    hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali

    C P 2 Replies Last reply
    0
    • A alimohammed

      hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      AJAX does a postback, so you'd do the same thing, just wrap your button in ATLAS stuff so it uses AJAX.

      Christian Graus - C++ MVP

      A 1 Reply Last reply
      0
      • A alimohammed

        hi all, anyone please help me to dynamically create a server control in the form using Microsoft AJAX toolkit dll. For eg: i will type a number in a textbox, say 10, and when i click on a button called "create" 10 text boxes must be created on the form, is there any way using ajax toolkit, i have done it in post back, but i have to avoid post back. Thanks. Ali

        P Offline
        P Offline
        Pavan Naidu
        wrote on last edited by
        #3

        Hi, You said you done it in postback, then you can call code behind method (which have your control creation code) using ajax. Search for AjaxPro dll file. Regards, Pavan.

        1 Reply Last reply
        0
        • C Christian Graus

          AJAX does a postback, so you'd do the same thing, just wrap your button in ATLAS stuff so it uses AJAX.

          Christian Graus - C++ MVP

          A Offline
          A Offline
          alimohammed
          wrote on last edited by
          #4

          Graus i know ajax does post back, but it does not do complete post back of the web form, i just wanna post back only the part of the webform with newly created textboxes, which component in the toolkit i should use?

          C 1 Reply Last reply
          0
          • A alimohammed

            Graus i know ajax does post back, but it does not do complete post back of the web form, i just wanna post back only the part of the webform with newly created textboxes, which component in the toolkit i should use?

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            You would just add the textboxes to the controls collection, surely ? Add a control to act as a placeholder, and add the textboxes to it.  If that doesn't work, then I don't know if you can do it ( at least, not with viewstate support, you can easily return the HTML to show textboxes and add it to the page using AJAX ).

            Christian Graus - C++ MVP

            A 1 Reply Last reply
            0
            • C Christian Graus

              You would just add the textboxes to the controls collection, surely ? Add a control to act as a placeholder, and add the textboxes to it.  If that doesn't work, then I don't know if you can do it ( at least, not with viewstate support, you can easily return the HTML to show textboxes and add it to the page using AJAX ).

              Christian Graus - C++ MVP

              A Offline
              A Offline
              alimohammed
              wrote on last edited by
              #6

              Hi friend i'l tel u wat exactly is going on. i created aspx text boxes and buttons using code behind, as u said in a placeholder. and i know to create html textboxes and buttons using ajax dll ( using dynamic populate component), but i cannot wrap button click event for this dynamically created html button ( button1_serverclick) because dynamic populate only returns a string corresponds to html tag. if i could create button click event using dynamic populate, i wouldnt have gone for an alternate solution. but, i couldnt. thats why i am looking to create aspx buttons. hope u got the idea now. thanks Ali

              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