ListItem doesn't fire event handler when first item is selected

G

Gilbert Biro Simon

I have a dropdownlist that I am intending on using as a re-director in an
Coorporate Intranet page using frames. The top frame contains the
dropdownlist (listitem) which contains the main categories of indices. The
bottom frame will contain the category index that was selected using the
listitem control.

The form code in the html follows:

<asp:dropdownlist id="cboRedirector" runat="server" AutoPostBack="true">
<asp:ListItem Value="indexdefault.aspx">Select Category</asp:ListItem>
<asp:ListItem Value="indextechsupport.aspx">Technical
Support</asp:ListItem>
<asp:ListItem Value="indexisodocs.aspx">ISO Documents</asp:ListItem>
<asp:ListItem Value="indexcalendar.aspx">Calendar</asp:ListItem>
<asp:ListItem Value="indexphonedir.aspx">Phone Extensions</asp:ListItem>
<asp:ListItem Value="indexweather.aspx">Weather Radar Sites</asp:ListItem>
<asp:ListItem Value="indexmaps.aspx">Map Sites</asp:ListItem>
</asp:dropdownlist>

The event handler code in the aspx.vb code-behind follows. The
Respose.Redirect line that is remarked out is the real code. The Select
Case/End Select block has been put in for debugging purposes.

Private Sub cboRedirector_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
cboRedirector.SelectedIndexChanged
Select Case cboRedirector.SelectedValue
Case "indexdefault.aspx"
Stop
Case "indextechsupport.aspx"
Stop
Case "indexisodocs.aspx"
Stop
Case "indexcalendar.aspx"
Stop
Case "indexphonedir.aspx"
Stop
Case "indexweather.aspx"
Stop
Case "indexmaps.aspx"
Stop
End Select
'Response.Redirect("http://localhost/knights/" & cboRedirector.SelectedValue)
End Sub

When I select anything in the listitem except for the first listing the
Response.Redirect puts the proper page in the bottom frame - I'm using a
<base target="bottom"> in the head to achieve the proper placement of the
category indices.

When the first item is selected after another item has been selected the
code-behind event handler is not fired. I see that because I do not get the
Stop in the Select Case/End Select code. Instead the page that contains the
list item is displayed in the bottom frame. This results in the listitem
showing in both the top and the bottom frame.

I don’t want to use a “Go There†button. I prefer to have the page load by
simply selecting it in the dropdownlist. I’ve used this very successfully in
Java but now want my code to be exclusively in Visual Basic .NET 2003.

Does anyone have an answer to this? It is starting to drive me nucking
futs!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top