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
ropDownList ID="DropDownList1" Runat="Server"
AutoPostBack="True"
DataSourceID="DDL1Source"
DataTextField="category"
DataValueField="categoryValue"
OnSelectedIndexChanged="_OnSelectedIndexChanged1"
</asp
ropDownList>
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
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
AutoPostBack="True"
DataSourceID="DDL1Source"
DataTextField="category"
DataValueField="categoryValue"
OnSelectedIndexChanged="_OnSelectedIndexChanged1"
</asp
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