dynamically creating textboxes based on sql records

T

Tony

Is there a recommended way to have a form that is a list of textboxes from
a sql table based on a username that then puts the captured data back into
the db?

I have a table |userid|skill|level|. I need to display the list to the
user, have them update the level and then store this data back into the
table. I can't seem to create the textboxes as asp controls with a unique
id based on the text in the skill field.(to enable me to put the data back
into the database)

thanks for any help or pointers

tony
 
T

Tony

Tony,

Why not to use datagrid? You can make template columns containing
textboxes.

Eliyahu

Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Thanks

Tony
 
E

Eliyahu Goldin

Tony,

Why not to use datagrid? You can make template columns containing textboxes.

Eliyahu
 
E

Eliyahu Goldin

Tony,

I don't know much about tutorials, sorry. As to id, it is known. Look at
UniqueId property. It is made specially for your purposes.

Eliyahu
 
D

Dan Brussee

Hi, can you tell me where to find a good tutorial on templates? I have had
a look at a few but nothing for the beginner. Do any show how to access
the textbox on a post back when the id is not known(Created dynamically)?

Think again about the "not known" comment. Something had to be used to
determine which text boxes were to be created. That same code should
be used again to get the text boxes and their contents.
 
J

Jeff Louie

Tony.... You just need to persist the primary key for the row "in" the
HTML
page. So first you must get the primary key for the row and then you
must
decided how to "persist" the value into the page (using viewstate,
session,
hidden field). If the primary key is the person's name you could have
problems if two people have the same name. If this is confusing, you
could
read up on the terms candidate key, primary key, simple key and compound
key.

Regards,
Jeff
I can't seem to create the textboxes as asp controls with a unique
id based on the text in the skill field.(to enable me to put the data
back
into the database)<


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top