I have an ASPx page, let's call it a request transaction, that contains a combination of TextBoxes, CheckBoxes and DropDownLists. The user is required to complete all of the fields. Once all fields have been completed, the user has the option to save the information and enter additional requests (by completing all the fields and clicking the SAVE button) or submit the request (by clicking the submit button).
If the SAVE button is clicked, a DataList will be created. A DataRow will be added each time the SAVE button is clicked. The user can edit any request in the datalist by clicking the edit LinkButton corresponding to the line item in the DataList. Once the edit button is clicked, all of the values stored for the request to be edited are displayed. I know how to populate the TextBox controls in the EditItemTemplate. However, I am having problems with populating the Checkbox controls with the stored values (i.e. checked or unchecked). I am also having difficulties determining the best way to handle DropDownLists in the EditItemTemplate. I can't use ListItems to populate the DropDownList on the ASPx page, so I know that I have to use the DataSource, DataValueField and DataTextFields and then provide some code-behind logic. I can't use a database table for the solution so what do I do? I thought about using the web.config file to store values that can be retrieved. I also thought about binding a collection to the dropdownlist. I prefer the web.config approach because it can be used by other requests in the solution and would prevent me from having to hardcode the data contained in the DropDownList. Once the DropDownLists have been created, I will need to set the Selected property to item that matches the value that was stored for the request. Can anyone help me with this problem?
If the SAVE button is clicked, a DataList will be created. A DataRow will be added each time the SAVE button is clicked. The user can edit any request in the datalist by clicking the edit LinkButton corresponding to the line item in the DataList. Once the edit button is clicked, all of the values stored for the request to be edited are displayed. I know how to populate the TextBox controls in the EditItemTemplate. However, I am having problems with populating the Checkbox controls with the stored values (i.e. checked or unchecked). I am also having difficulties determining the best way to handle DropDownLists in the EditItemTemplate. I can't use ListItems to populate the DropDownList on the ASPx page, so I know that I have to use the DataSource, DataValueField and DataTextFields and then provide some code-behind logic. I can't use a database table for the solution so what do I do? I thought about using the web.config file to store values that can be retrieved. I also thought about binding a collection to the dropdownlist. I prefer the web.config approach because it can be used by other requests in the solution and would prevent me from having to hardcode the data contained in the DropDownList. Once the DropDownLists have been created, I will need to set the Selected property to item that matches the value that was stored for the request. Can anyone help me with this problem?