E
Ed
I have in a Web page a drop down list. It gets initialized in
Page_Load:
ddlTop.Items.Clear()
ddlTop.Items.Add("All")
ddlTop.Items.Add("Hard")
ddlTop.Items.Add("Soft")
In the same page I have a button with. In the code section I have :
Private Sub GetTable_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnGetTable.Click
.....
Response.Write("Top = " & ddlTop.SelectedItem.ToString)
.....
End sub
Yet when I open the page in the browser and select "Hard" from the
dropdown list then click the button the Response is always "All".
The problem is the dropdown list is getting reinitializied when the
button is clicked.
What am I missing here?
TIA
Ed
Page_Load:
ddlTop.Items.Clear()
ddlTop.Items.Add("All")
ddlTop.Items.Add("Hard")
ddlTop.Items.Add("Soft")
In the same page I have a button with. In the code section I have :
Private Sub GetTable_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnGetTable.Click
.....
Response.Write("Top = " & ddlTop.SelectedItem.ToString)
.....
End sub
Yet when I open the page in the browser and select "Hard" from the
dropdown list then click the button the Response is always "All".
The problem is the dropdown list is getting reinitializied when the
button is clicked.
What am I missing here?
TIA
Ed