M
Me LK
I have a drop down list nested in a datagrid. It works fine. When
there is no data in he DDL I change the list to visible = false and
show a label with the word "none". That works fine. What I need to do
now is list the word "none" in the database if there is no value in
the DDL. This I can not seem to do. Here is the code I have tried
Private Sub iteminfo_selectedindexchange(ByVal sender As
System.Object, ByVal e As EventArgs) Handles
itemInfo.SelectedIndexChanged
Dim Psize
Dim ddlPsize As DropDownList
ddlPsize =
itemInfo.Items(itemInfo.SelectedIndex).FindControl("ddlsizes")
If ddlPsize.Items.Count < 1 Then
Psize = "none"
Else
Psize = ddlPsize.SelectedValue
End If
If there is a value in the ddl then the correct value is placed in the
database. If there is no value in the DDL and the user clicks the add
to cart button the page refreshes, grid is gone and there is nothing
at all in the database.
there is no data in he DDL I change the list to visible = false and
show a label with the word "none". That works fine. What I need to do
now is list the word "none" in the database if there is no value in
the DDL. This I can not seem to do. Here is the code I have tried
Private Sub iteminfo_selectedindexchange(ByVal sender As
System.Object, ByVal e As EventArgs) Handles
itemInfo.SelectedIndexChanged
Dim Psize
Dim ddlPsize As DropDownList
ddlPsize =
itemInfo.Items(itemInfo.SelectedIndex).FindControl("ddlsizes")
If ddlPsize.Items.Count < 1 Then
Psize = "none"
Else
Psize = ddlPsize.SelectedValue
End If
If there is a value in the ddl then the correct value is placed in the
database. If there is no value in the DDL and the user clicks the add
to cart button the page refreshes, grid is gone and there is nothing
at all in the database.