Enter records in excel like structure and save in database???

Posted by Modit under ASP.NET on 6/11/2011 | Points: 10 | Views : 1498 | Status : [Member] | Replies : 1
hi, I am looking for something that have a grid like excel . The columns are fixed lets say Roll , Name and Marks. The user can keep on adding records in that structure. By pressing TAB key a new row would be automatically added. Once finished adding the records he can press the button and save it in a database.


Posted by: SheoNarayan on: 6/11/2011 [Administrator] HonoraryPlatinum | Points: 25

Hi Modit,

Of course this is possible however you should have very good knowledge about JavaScript or jQuery to do this.

On click of tab (you need to handle the keypress event at the last button and check for the keycode to see if it is tab) you can dynamically create the texboxes and add into the html table.

You can check the responses of this thread http://www.dotnetfunda.com/forums/thread4873-dynamically-add-textboxes-per-row-using-jquery.aspx (The first response uses jQuery).

To retrieve the dynamically added textbox values in the server side, you will have to use Request.Form["textboxname"].

Hope this will give some idea.


Sheo Narayan

Modit, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response