Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting element values

Status
Not open for further replies.

Sidrp

IS-IT--Management
Jun 4, 2003
44
US
HI All..
I was basically a ASP programmer trying my hand at ASP.net.
I have been struggling with a functionality lately..May be someone can show me the way.
I have a table with price list for different category of items..like DIfferent HDD, RAM, Motherboard..I want my user to pick one element from each group to assemble a PC. I have different lines of products for different PCS and hence I can not generalise. I have to pull the items from the table and display them with radio button. I am doing this by using a Datareader. The values are displayed dynamically in a table, I am adding rows and cells and adding radiobutton to each cell dynamically.
Now my problems is how do I fetch the values from the table/form. I have the table inside the form and the table has multiple rows. (column number remains same). Now I can access the controls collection, but there is no way I can read the state of an element? In ASP I justed parsed through the form looking for radiobuttons and on check property get the values and it was pretty much straightformward from there on. How do I do it for ASP.net?
Any ideas? May be I am making some mistakes..If you want I can post the code..although its very raw and unformatted right now..

Any help is really appriciated..
thanks
Sid
 
This is a well-discussed topic.

When you say that you "add rows/cells/radiobuttons", are you adding HTML stuff or ASP.NET Server Controls?

If true server controls, then search this forum for "Dynamic Controls" for a lot of threads.

If HTML, then switch to server controls!



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Hi Thomas,
thanks for the reply..wht I am doing is instantiating a new control and then adding it to the table in a do while loop.. I am not sure if this is the right way or not..but I am instantiating new radiobutton in each while loop..it picks up a unique id on its own..all I do it assign it a group name so it belongs to one group..in this scenario..how do i access the radiobutton state? also is there a way I can assign a value to the radiobutton?
thanks
Sid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top