473,569 Members | 2,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drop Down List Problem

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 _OnSelectedInde xChanged1(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList1.S electedValue = "Choose a Report Category"
Then
DropDownList2.V isible = False
DropDownList3.V isible = False
masterCalendar. Visible = False
End If
If DropDownList1.S electedValue = "DailyRepor ts"
DropDownlist2.V isible = True
masterCalendar. Visible = True
DropDownList3.V isible = False
End If
If Not DropDownList1.S electedValue = "Choose Category" And Not
DropDownList1.S electedValue = "DailyRepor ts"
DropDownlist2.V isible = True
DropDownList3.V isible = False
masterCalendar. Visible = False
End If
End Sub
Public Sub _OnSelectedInde xChanged2(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList2.S electedValue = "Choose a Report" Or
DropDownList2.S electedValue = "Choose a Website" Then
DropDownList3.V isible = False
End If
If DropDownList2.S electedValue = "DailyRepor ts1" Or
DropDownList2.S electedValue = "DailyRepor ts2" Then
DropDownList3.V isible = False
masterCalendar. Visible = True
End If
If DropDownList2.S electedValue = "ABC2006" Or
DropDownList2.S electedValue = "DEF2006" Then
DropDownList3.V isible = True
masterCalendar. Visible = False
End If
If InStr(DropDownL ist2.SelectedVa lue, "http://") Then
Response.Redire ct(DropDownList 2.SelectedValue )
End If
End Sub
Most of the drop downs are similar to below...
<asp:DropDownLi st ID="DropDownLis t1" Runat="Server"
AutoPostBack="T rue"
DataSourceID="D DL1Source"
DataTextField=" category"
DataValueField= "categoryVa lue"

OnSelectedIndex Changed="_OnSel ectedIndexChang ed1"
</asp:DropDownLis t>

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

Mar 29 '06 #1
2 1461
Have you thought about something like the treeview control to acheive this
instead of drop down lists?

"ne***********@ gmail.com" wrote:
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 _OnSelectedInde xChanged1(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList1.S electedValue = "Choose a Report Category"
Then
DropDownList2.V isible = False
DropDownList3.V isible = False
masterCalendar. Visible = False
End If
If DropDownList1.S electedValue = "DailyRepor ts"
DropDownlist2.V isible = True
masterCalendar. Visible = True
DropDownList3.V isible = False
End If
If Not DropDownList1.S electedValue = "Choose Category" And Not
DropDownList1.S electedValue = "DailyRepor ts"
DropDownlist2.V isible = True
DropDownList3.V isible = False
masterCalendar. Visible = False
End If
End Sub
Public Sub _OnSelectedInde xChanged2(ByVal Sender As Object, ByVal e

As EventArgs)
If DropDownList2.S electedValue = "Choose a Report" Or
DropDownList2.S electedValue = "Choose a Website" Then
DropDownList3.V isible = False
End If
If DropDownList2.S electedValue = "DailyRepor ts1" Or
DropDownList2.S electedValue = "DailyRepor ts2" Then
DropDownList3.V isible = False
masterCalendar. Visible = True
End If
If DropDownList2.S electedValue = "ABC2006" Or
DropDownList2.S electedValue = "DEF2006" Then
DropDownList3.V isible = True
masterCalendar. Visible = False
End If
If InStr(DropDownL ist2.SelectedVa lue, "http://") Then
Response.Redire ct(DropDownList 2.SelectedValue )
End If
End Sub
Most of the drop downs are similar to below...
<asp:DropDownLi st ID="DropDownLis t1" Runat="Server"
AutoPostBack="T rue"
DataSourceID="D DL1Source"
DataTextField=" category"
DataValueField= "categoryVa lue"

OnSelectedIndex Changed="_OnSel ectedIndexChang ed1"
</asp:DropDownLis t>

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

Mar 29 '06 #2
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

Mar 29 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6144
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box that appear when user clicks the drop-down arrow button. Because items in the Drop down list are a little long, user can't see the full thing when...
13
5230
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data structures? Thanks for any hints, Leszek Taratuta
2
12600
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list...
5
4212
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
4
1511
by: Laura K | last post by:
I have a drop down menu which has a list of subcategories and the initial value is "please choose a Subcategory". When the user chooses a subcategory they are taken to a new page where the drop down list shows the selected subcategory in the menu. So far that is working. The problem is that when the list is showing the subcategory on the...
0
1503
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my database has been made in MSDE. My question is simple, on my Projects form I have a 'search' button, which when clicked re-binds a datagrid with a...
4
9278
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me if it works, and if it does not, tell me why it does not work. Thanks.
3
7340
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is...
0
2334
by: yosri2005 | last post by:
Hello, I'm sure many of you have seen the error message in the subject. I found quiet a few posts on the web regarding this issue, but the ones I saw mainly tackle this issue when you have a drop-down list depending on another drop-down list within a form view. This is not what I'm trying to do, so I didn't know how to apply the solutions I...
3
5867
by: jcassan | last post by:
Hello folks. I am new to these forums and have something, which has been stumping me for little while. I am using pspell to spellcheck a scrolling textbox (textarea) containing user input. I analyze each word and rebuild the text string as a combination of correct text (not misspelled) and a drop down list offering suggestions in place of...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.