dynamically adding textboxes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganesh22
    Banned
    New Member
    • Sep 2007
    • 81

    dynamically adding textboxes

    Hi,

    My requriment is i want to give dinamicaly adding controls in my asp.net web page . that means if i click add button dinamicallly add textboxs in my page. like wise how many times if i click add buton such textboxs will apper how to do
  • antonmaju
    New Member
    • Apr 2008
    • 7

    #2
    You may use Javascript, and then use document.create Element('input' ) and set its type as textbox.
    Just remember because you create the controls from client side, they won't have Viewstate.
    So if you want to post the value back to server, I suggest you use Javascript too. I believe ASP.NET Ajax library will help you a lot.
    If you choose to maintain state from dynamic controls, you may refer to http://aspnet.4guysfro mrolla.com/articles/081402-1.aspx

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by ganesh22
      Hi,

      My requriment is i want to give dinamicaly adding controls in my asp.net web page . that means if i click add button dinamicallly add textboxs in my page. like wise how many times if i click add buton such textboxs will apper how to do

      Have you see the .Net article on How To Use Dynamic Controls in ASP.NET?

      There is an example of how to dynamically create TextBoxes in that article.

      -Frinny

      Comment

      • rathishr
        New Member
        • Nov 2008
        • 5

        #4
        i have written a code for adding textbox on button click.
        now what i wanna do is to access the value in the textbox in the next page
        can anyone help

        Comment

        • tlhintoq
          Recognized Expert Specialist
          • Mar 2008
          • 3532

          #5
          Originally posted by rathishr
          i have written a code for adding textbox on button click.
          now what i wanna do is to access the value in the textbox in the next page
          can anyone help

          This reads like you are the Original Poster, Ganesh22 who has been banned.

          If you are someone different, you really should start your own question and not try to tag in on another post - Especially by someone who is banned. It won't lead to good answers to your specific question: If any at all.

          Also, when you post your new question, you should include the code fragment where you are having trouble, so those here can see what you are doing in an effort to help.

          Comment

          Working...