473,782 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retain the Dropdown value while reload of page in ASP

1 New Member
I have a page in which there is a drop down list.the values in drop down list are the pages.now in one page i am adding a flag which is in an external window.As soon as I save my flag and the external window gets closed, my parent page where the drop down list is present gets refreshed and the dropdown list value goes to the default value i.e. 1st value.So how to retain the value?. for eg:-4th value.
Feb 2 '07 #1
2 2890
senaka
23 New Member
I have a page in which there is a drop down list.the values in drop down list are the pages.now in one page i am adding a flag which is in an external window.As soon as I save my flag and the external window gets closed, my parent page where the drop down list is present gets refreshed and the dropdown list value goes to the default value i.e. 1st value.So how to retain the value?. for eg:-4th value.
you should be able to get through this using ASP only. is it essential to use javascript in here?
Feb 2 '07 #2
gateshosting
25 New Member
Simple... I am guessing you are using javascript's window.location = to send them to a new page. The easiest way is to probably do a compare.
Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3. cPage = request.servervariables("script_name")
  4.  
  5. %>
  6. <option value='/mypage.asp'<%
  7.   if cPage = "/mypage.asp" then
  8.     response.write " selected"
  9.   end if %>>Take me to My Page</option>
  10.  
You can do this inline, but to make it clear, I wrote it on a few lines.

Best regards,

Michael C. Gates
Feb 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2705
by: Pete | last post by:
Just a quick question regarding the way to do something rather than the actual code :- I have a page which has some links that go through to a HTML form and each link will check a certain checkbox. I want the form to retain the checked status of any checkboxes that are set to checked when the user goes back to the previous page. Would this be best done using sessions or is there another way I could use? I don't mind using sessions...
24
77395
by: London | last post by:
Hello Can you help me. By ASP How can I get the dropdown(control'name)'s selected value? What is it's property'name?
3
6458
by: KathyB | last post by:
Hi, Been reading a LOT about frames, variables, etc. I realize you can NOT use server.transfer with target frames (which are client)... I have a Parent frame containing Left and Right frames. IS IT POSSIBLE (and HOW please) to do the following: 4 text controls filled in by user in Left frame, with a button click event to:
9
1821
by: Chris | last post by:
I pop up a Modal form on a web page that allows the user to update the selections of a dropdownlist via adding a new item to the db (Sql Server).The only thing is this list is on the page beneath it. So when the user updates the db with a new selection, and then closes the form, the page below must be refreshed to see the new option. Any ideas on adding the new option to the control below the modal form? thanx.
1
2095
by: Stuart Shay | last post by:
Hello All: I hava a ASP.NET Web Page where I want to change the visibility of a Dropdown, I want to avoid using Postback since the selection of the Dropdown choices is always the same. The Code below is just a date filter selection. The Code works fine but on page postback I want to reload the Js script so the Dropdown visibility selection remains.
2
1374
by: Brian | last post by:
Hi, All, I have two dropdown lists in itemtemplate in a datagrid. for example, dropA and dropB. also, for the dropdown, I set < Runat="server" AutoPostBack="True" OnSelectedIndexChanged="some event name"> When users selects an item, it will do a postback to server. Before the postback completes and the page refreshes, click any dropdown menu again (either dropA or dropB) the frame page will become blank out. I must to click F5 or refresh...
2
2424
vijcbe
by: vijcbe | last post by:
Hello friends, I am having a big time problem. I have a list of textboxes, radios, etc., in a login page for the user to enter his/her data. I have two drop downs, in which the second one is populated according to the first one's choice. I used javascript onchange function to do this. Later in the Js, I get the selected value and pass it to PHP again so that the second dropdown is populated accoding to the first choice. Coding: function...
2
4013
by: raamay | last post by:
I want to have a dynamic dropdown box whose entries would depend on the selection of an entry in the first dropdown box. BUT the second dropdown box should not reload, only the entries inside should get refreshed or reloaded. i have a piece of code to create a dynamic dropdown box from w3schools.com but it has the problem of reloading the second dropdown box as well. Please see my code: //index.php <html> <head> <script...
5
3588
by: raamay | last post by:
i have a form via which new users can register their information along with their Resume. Now when input validation is done, if there is some errors, then the page is reloaded with the users information retained for necessary correction. In this process i find the file name and local path missing every time. So, how should we retain the local file path during page reload.
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.