A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I'm using Visual Web Develper Express to develop a web application, and have created a dropdown list on a form with the id DDL. My data source DS uses a single table T with all three of its fields selected for use in the SQL statement. Field F1 is used for the value, field F2 is used for the displayed name, and field F3 is not used for the list. I've created a handler for when a new selection is made, but I need to store the value of F3 in a session variable and cannot figure out how to access the value of F3 in the selected row. I'm new at this (obviously) and any help would be appreciated. Thanks
The web is stateless.
Your DropDownList control and DataSource exist on the server only. When your page is rendered, your DDL is converted into an HTML select element. The option elements have display text and value attributes. F3 does not exist at this point - therefore, on postback there is no way to retrieve it without first re-binding your data and figuring out which F3 was associated with the selected value, F1.
You might want to use a GridView instead, and set F3 as one of the DataKeyNames.
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz