generate dynamic textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sejal17
    New Member
    • Dec 2007
    • 56

    generate dynamic textbox

    hello everyone,
    I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

    also i have another fields on that page.

    company name;
    card type:
    card Name:
    pin:

    i want this for pin field.

    also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

    can anyone has solution for this problem .

    thanks in advance.
  • PareshRathod
    New Member
    • Mar 2007
    • 28

    #2
    Hello Sejal,

    First of all i will ask that are you asking it for web application or windows application?

    And kindly write about the language in which you are developing, so that user can answer accordingly...

    Paresh

    Originally posted by sejal17
    hello everyone,
    I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

    also i have another fields on that page.

    company name;
    card type:
    card Name:
    pin:

    i want this for pin field.

    also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

    can anyone has solution for this problem .

    thanks in advance.

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by sejal17
      hello everyone,
      I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

      also i have another fields on that page.

      company name;
      card type:
      card Name:
      pin:

      i want this for pin field.

      also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

      can anyone has solution for this problem .

      thanks in advance.
      creating dynamic textbox is easy.....on linkbutton's click event just write

      [CODE=vbnet] Dim tb As TextBox
      tb=new Textbox
      [/CODE]

      in code you have to set the appropriate location for the textbox...

      [CODE=vbnet] tb.Location=new Point(x,y)[/CODE]

      the scond portion of your code requires some learning.....pl ease learn about Database design......if a single company name/card type/card Name entry has 4 pin then you should maintain a second table for pin only.........

      lastly but most importantly.... .............
      please obey the posting guidelines..
      you have not mention your Database/Language/Project type.....

      Comment

      • sejal17
        New Member
        • Dec 2007
        • 56

        #4
        Originally posted by PareshRathod
        Hello Sejal,

        First of all i will ask that are you asking it for web application or windows application?

        And kindly write about the language in which you are developing, so that user can answer accordingly...

        Paresh
        Hello Paresh

        I want it in asp.net with language C#.

        Thnks in advance

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by sejal17
          Hello Paresh

          I want it in asp.net with language C#.

          Thnks in advance
          I'm currently working on an article explaining how to use dynamic controls in ASP.NET. The example in the article is in VB.NET but I think you can get the general idea of how to make it work in C# from it.

          Please note that the article is still in rough draft stages.

          The article on Using Dynamic Controls in Asp.NET.

          -Frinny

          Comment

          • PareshRathod
            New Member
            • Mar 2007
            • 28

            #6
            Can you please tell us about the problem you are facing???
            Or you have no idea about the thing...

            You can add the control to web form by:

            TextBox txt = new TextBox();
            this.form1.Cont rols.Add(txt);

            You can add custom styles also to the above mentioned txt.
            If you are having still problem, kindly contact me at <snipped> with screen shots your application, i will definitely solve it...

            Paresh

            Originally posted by PareshRathod
            Hello Sejal,

            First of all i will ask that are you asking it for web application or windows application?

            And kindly write about the language in which you are developing, so that user can answer accordingly...

            Paresh
            Last edited by Frinavale; Jan 8 '08, 02:03 PM. Reason: Removing email

            Comment

            • sejal17
              New Member
              • Dec 2007
              • 56

              #7
              Originally posted by PareshRathod
              Can you please tell us about the problem you are facing???
              Or you have no idea about the thing...

              You can add the control to web form by:

              TextBox txt = new TextBox();
              this.form1.Cont rols.Add(txt);

              You can add custom styles also to the above mentioned txt.
              If you are having still problem, kindly contact me at <snipped> with screen shots your application, i will definitely solve it...

              Paresh



              hello everyone,

              I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

              also i have another fields on that page.

              company name;
              card type:
              card Name:
              pin:

              i want this for pin field.

              also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

              I want it for asp.net with language c#.

              can anyone has solution for this problem .

              thanks in advance.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Originally posted by sejal17
                hello everyone,

                I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

                also i have another fields on that page.

                company name;
                card type:
                card Name:
                pin:

                i want this for pin field.

                also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

                I want it for asp.net with language c#.

                can anyone has solution for this problem .

                thanks in advance.
                The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

                -Moderator Frinny

                Comment

                • dip_developer
                  Recognized Expert Contributor
                  • Aug 2006
                  • 648

                  #9
                  Originally posted by sejal17
                  hello everyone,

                  I have a problem with dynamically generating textbox.I have one link button .i want that when i click on link button then text box is created.when i click next time it will generate second textbox.then third,forth....

                  also i have another fields on that page.

                  company name;
                  card type:
                  card Name:
                  pin:

                  i want this for pin field.

                  also that if i generate 4 textbox for pin then when i insert the record it will insert for record depend on 4 pin added in pin textboxs.but the company,card type,card name all this field are same for this four record.

                  I want it for asp.net with language c#.

                  can anyone has solution for this problem .

                  thanks in advance.
                  i have already given you the code.....the one line i missed is as follows......
                  [CODE=vbnet]
                  // Add control to the forms control collection after generating it
                  // dynamically
                  Me.Controls.Add (tb)[/CODE]

                  please dont post your question twice........

                  Coding in C# is not a hard task to do.....please learn the syntax...it has minimal difference with VB.NET.......yo u should be familiar with both the language......i ts for your betterment.....

                  Comment

                  Working...