M
MU
Hello
I have a form with a dropdownlist on it and in the page_load I have
this to populate it:
Dim productsAdapter As New ProductsTableAdapter
drpProducts.DataSource = productsAdapter.GetProducts()
drpProducts.DataTextField = "Title"
drpProducts.DataValueField = "ProductID"
drpProducts.DataBind()
Here is the drop down list:
<aspropDownList ID="drpProducts" runat="server"
AutoPostBack="True" class="textbox">
</aspropDownList>
It populates with the correct fields etc but when the postback
happens, it refreshes the list and goes back to the 1st item in the
list, it doesn't maintain view state. IE. if I choose the 3rd in the
list, it doesn't refresh the page back and select the 3rd in the list
again, I'm assuming it's because of the code in the page_load.
How do I make it stay on the selected list item as I will be using it
with a gridview below it to edit records.
Thanks
MU
I have a form with a dropdownlist on it and in the page_load I have
this to populate it:
Dim productsAdapter As New ProductsTableAdapter
drpProducts.DataSource = productsAdapter.GetProducts()
drpProducts.DataTextField = "Title"
drpProducts.DataValueField = "ProductID"
drpProducts.DataBind()
Here is the drop down list:
<aspropDownList ID="drpProducts" runat="server"
AutoPostBack="True" class="textbox">
</aspropDownList>
It populates with the correct fields etc but when the postback
happens, it refreshes the list and goes back to the 1st item in the
list, it doesn't maintain view state. IE. if I choose the 3rd in the
list, it doesn't refresh the page back and select the 3rd in the list
again, I'm assuming it's because of the code in the page_load.
How do I make it stay on the selected list item as I will be using it
with a gridview below it to edit records.
Thanks
MU