I have a slight issue I awas trying to fix for 2-3 days, but nothing I try works.
DetailsView control in edit mode, I pass parameters to the SqlDataSourceProducts (edit.aspx?id=2) and the data source selects the appropriate data and fills in the DetailsView form.
Except two drop down lists. These two DDLs (DDL2 and DDL3) are dependent on the previous DDL (DDL1) in the DetailsView.
Thanks to PeteNet, when the selected value of the DDL1 changes, DDL2 and 3 change their lists and get bound to the database.
The problem is: when I edit something from the database, DDL2 and 3 appear empty and when I update any other field and leave these, they get blanked in the database.
My goal is to set the selected value of DDL2 and 3 to the values in the database WHERE ID = QueryStringField="id".
I can go for not binding the data unless the field is changed, but does not sound professional and user friendly.
The SqlDataSource used to select the parameters from the table and populate the DetailsView
<asp:SqlDataSource ID="SqlDataSourceProduct" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT ID, wm_number, upc, check_digit, unit, price_unit, brand, category, shelves, type, cooking, storage, packaging, origin, nutriti
View Complete Post