Hi
I have added a drop downlist on the aspx page and filled it with items. It looks like this....
And in the codebehind I have this code...
But it never change what it write out, it always write the same..... What am I doing wrong here?
I have added a drop downlist on the aspx page and filled it with items. It looks like this....
And in the codebehind I have this code...
Code:
<asp:dropdownlist id="ddl" runat="server" Width="144px" AutoPostBack="true" SelectedIndexChanged="Selection_Change">
<asp:ListItem Value="0">choose:ListItem>
<asp:ListItem Value="1">Item 1</asp:ListItem>
<asp:ListItem Value="2">Item 2</asp:ListItem>
<asp:ListItem Value="3">Item 3</asp:ListItem>
<asp:ListItem Value="4">Item 4</asp:ListItem>
<asp:ListItem Value="5">Item 5</asp:ListItem>
<asp:ListItem Value="6">Item 6</asp:ListItem>
<asp:ListItem Value="7">Item 7</asp:ListItem>
</asp:dropdownlist>
Code:
Sub Selection_Change(ByVal sender As Object, ByVal e As EventArgs) Handles ddl.SelectedIndexChanged
Response.Write(ddl.SelectedItem.Value & " - Text = " & ddl.SelectedItem.Text)
End Sub
But it never change what it write out, it always write the same..... What am I doing wrong here?