You must Sign In to post a response.
  • Category: ASP.NET

    How to create Multiple dynamic Textbox and how to get & save they value into database

    hi Friends ,

    am doing a project like a job portal

    so education details are filled by the candidate
    i.e c.
    sslc , hsc,ug and pg
    sslc and hsc filled up normnal text boxes.
    but ug details is need add more

    1.Name of the College
    3.Year of Passing
    if the candidate done diploma and ug he have to add .
    so neeed add more button or link .
    if candidate click the link na a new Column is populate with the Same 4 Fields.
    which is filled up by the candidate last time.
    in last i want a small Delete button or link. because if candidate added but he not needed that time he can able to delete the Column

    same requirement as pg is no problem .
    once i am done this on ug copy and paste to pg.

    So please friend please suggest me the best way to how i am done this task.

    i have to done it this requirement with in today .
    sorry for my inconvienence.
    thanks with
  • #767892

    I assume that you are maintain this in one gridview control, in gridview we have different type of templates, for records display we are using ItemTemplate, for header we are using HeaderTemplate, but in your case along with above 2 templates you have to implement Footer for click Add new entry so you can use FooterTemplate, after implement this you can use gridview onrowcommand event for adding entries into database.

    Protected void gv_RowCommand(Object sender, GridViewCommandEventArgs e)
    //add record into database

    once you add entry into database then on each row you have to implement one column for edit/delete an entry. while click delete button again you have to go back to gridview rowcommand event with command name delete,

    Protected void gv_RowCommand(Object sender, GridViewCommandEventArgs e)
    //delete record from database or inactive the record in database.

    Try something like above, it helps you to achieve your task.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #767920
    i want wirhout gridview mr.neveen

  • #767921
    Hai Paul Raj,
    There are many previous posts in our website where you can find the solution of your query. I am providing few links which you can refer and get the probable solution:


    Hope it will be helpful to you.

    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)

  • #767930

    In that case you have to create one set of group and in that group you have to create controls dynamically as you want and while click on Add New row then create dynamic controls with full and different id and while click on save time add those records into database.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • #767949
    LoadViewState event is the key here, you need to create dynamic control and store its value in viewstate and finally save them in database see below snippet

    //define a new control class and add it in panel, see below snippet
    //Dynamic TextBox Panel

    pnlTextBox = new Panel();
    pnlTextBox.ID = "pnlTextBox";
    pnlTextBox.BorderWidth = 1;
    pnlTextBox.Width = 300;

    //button with handler
    //Button To add TextBoxes
    Button btnAddTxt = new Button();
    btnAddTxt.ID = "btnAddTxt";
    btnAddTxt.Text = "Add TextBox";
    btnAddTxt.Click += new System.EventHandler(btnAdd_Click);

    hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • Sign In to post your comments