.NET really makes me feel stupid. I'm trying to make a simple form with one dropdown box, populated but data from a SQL server database.
The drop down is populating fine, but the OnSelectedIndexChanged event isn't working the way I would think it should.
Here's my aspx.vb:
Here's the VB codebehind I'm trying to use:
Let me know if this isn't enough to tell what's wrong. I have no clue why it's not doing anything when I select something.
KizMar
------------
The drop down is populating fine, but the OnSelectedIndexChanged event isn't working the way I would think it should.
Here's my aspx.vb:
Code:
<form id="frmMealType" runat="server"> <table border="0" cellpadding="0" cellspacing="0" height="350">
<tr valign="top">
<td width="100" class="title">Meal Type</td>
<td>
<asp:DropDownList id="ddlMealType" runat="server" CssClass="dropdownlist" AutoPostBack="True" OnSelectedIndexChanged="ddlMealType_SelectedIndexChanged" />
</td>
</tr>
<tr>
<td colspan="2">
<h1><asp:Label id="lblStatus" runat="server" /></h1>
</td>
</tr>
</table>
</form>
Here's the VB codebehind I'm trying to use:
Code:
Public Sub ddlMealType_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlMealType.SelectedIndexChanged
' When a meal is selected, set session
Session("Serving") = Me.ddlMealType.SelectedItem.Value
' Testing
Me.lblStatus.Text = "Redirecting..."
' Send user to serving.aspx to start scanning students
Server.Transfer("serving.aspx")
End Sub
Let me know if this isn't enough to tell what's wrong. I have no clue why it's not doing anything when I select something.
KizMar
------------