B
Brian Lin
Hi all,
I have a table called Category and it has only two fields: CategoryID
and CategoryName. I want user to be able to enter 10 categories at one
page. So I what I do right now is to place 10 text input boxs on the
page with name txt1, txt2, txt3, etc. After the user submit. I will
check to see if each txt box is empty and insert into table if not.
The problem is that I need duplicate the code for each text box. I am
wondering if there is a way to just loop through those text boxes and do
the checking and inserting inside the loop. That would really cut down
the amount of codes.
I am new to asp.net, so please help
Thanks in advance,
Brian
I have a table called Category and it has only two fields: CategoryID
and CategoryName. I want user to be able to enter 10 categories at one
page. So I what I do right now is to place 10 text input boxs on the
page with name txt1, txt2, txt3, etc. After the user submit. I will
check to see if each txt box is empty and insert into table if not.
The problem is that I need duplicate the code for each text box. I am
wondering if there is a way to just loop through those text boxes and do
the checking and inserting inside the loop. That would really cut down
the amount of codes.
I am new to asp.net, so please help
Thanks in advance,
Brian