Administrateur
Administrateur

Reputation: 901

Creating and accessing control values dynamically

I have a DropDownList that gets populated from SQL on page load.

A user will select an item from the list and click a button.

Based upon the item selected, I need to fetch data from SQL. The results are then used to dynamically create a table with textboxes (for user input).

After filling out some textboxes, the user will click another button. I will need to loop through the dynamically created table and do some data processing with the values entered in the textboxes.

I'm having a hard time knowing when to create the dynamic table. If on Page_Init, how do I get the DropDownList selected value to pass to SQL? If on Page_Load, how am I going to re-create the the table with the user-entered values?

This is in C# .NET Framework 4.0 using Webforms

Upvotes: 1

Views: 157

Answers (1)

Administrateur
Administrateur

Reputation: 901

Found the solution. I'm using Request.Form[ddl.UniqueID] to get the DDL's selected value.

Upvotes: 1

Related Questions