Drop Down List Problem

N

newsgroups.jd

Thanks for any advice, help in advance...

I have 3 dropdownlist that populate based on choice in the previous
(nested essentially)


Problem is when I hit the back button and make a change in the second
or thrid dropdownlist it does not always redirect to the correct
site... What I really want to happen is
if the back button is pushed then everything clears and all starts from

first drop down list....

I have tried this at the top...
<%@ OutputCache Location="None" %>
but this causes the page expire message when the back button is pushed
which I dont want.

I run this script at the top...
<script runat="server">
Public Sub _OnSelectedIndexChanged1(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList1.SelectedValue = "Choose a Report Category"
Then
DropDownList2.Visible = False
DropDownList3.Visible = False
masterCalendar.Visible = False
End If
If DropDownList1.SelectedValue = "DailyReports"
DropDownlist2.Visible = True
masterCalendar.Visible = True
DropDownList3.Visible = False
End If
If Not DropDownList1.SelectedValue = "Choose Category" And Not
DropDownList1.SelectedValue = "DailyReports"
DropDownlist2.Visible = True
DropDownList3.Visible = False
masterCalendar.Visible = False
End If
End Sub


Public Sub _OnSelectedIndexChanged2(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList2.SelectedValue = "Choose a Report" Or
DropDownList2.SelectedValue = "Choose a Website" Then
DropDownList3.Visible = False
End If
If DropDownList2.SelectedValue = "DailyReports1" Or
DropDownList2.SelectedValue = "DailyReports2" Then
DropDownList3.Visible = False
masterCalendar.Visible = True
End If
If DropDownList2.SelectedValue = "ABC2006" Or
DropDownList2.SelectedValue = "DEF2006" Then
DropDownList3.Visible = True
masterCalendar.Visible = False
End If
If InStr(DropDownList2.SelectedValue, "http://") Then
Response.Redirect(DropDownList2.SelectedValue)
End If
End Sub


Most of the drop downs are similar to below...
<asp:DropDownList ID="DropDownList1" Runat="Server"
AutoPostBack="True"
DataSourceID="DDL1Source"
DataTextField="category"
DataValueField="categoryValue"

OnSelectedIndexChanged="_OnSelectedIndexChanged1"
</asp:DropDownList>

Drop down list navigation is all working, just when the back button is
pushed and you try to navigate to a different report, it redirects to
the origional choice.... wierd

Also if you see a better way to accomplish what I am doing here, please
feel free to comment. I am always trying to learn more than I know,
which is not much...

JD
 
G

Guest

Have you thought about something like the treeview control to acheive this
instead of drop down lists?
 
N

newsgroups.jd

I had something similar to a treeview before, but with hundred of
reports and probably 1000's eventually, the drop down list should
provide faster navigation. I also built in a calendar control for the
daily reports. Daily reports is selected from the dropdownlist1 and
type of daily from dropdownlist2, the calendar appears, date is
selected and redirect to that daily report.

My two main concerns are, is there a better way to code my solution and
two, how do I resolve the problem with hitting the back button?

Thanks!!

JD
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top