473,791 Members | 2,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

drop down question

I have 2 drop downs on my screen the second one is displayed and populated
based on the selection of the first drop down.
The problem i'm having is that when a user selects something it keeps going
back to the first item in the list - in this case is Select Car.
How can I keep the users selection displayed in the drop down?
Nov 18 '05 #1
4 1197
Are the all EnableViewState properties in True?


"IGotYourDotNet " wrote:
I have 2 drop downs on my screen the second one is displayed and populated
based on the selection of the first drop down.
The problem i'm having is that when a user selects something it keeps going
back to the first item in the list - in this case is Select Car.
How can I keep the users selection displayed in the drop down?

Nov 18 '05 #2
IGotYourDotNet wrote:
I have 2 drop downs on my screen the second one is displayed and populated
based on the selection of the first drop down.
The problem i'm having is that when a user selects something it keeps going
back to the first item in the list - in this case is Select Car.
How can I keep the users selection displayed in the drop down?

User RegisterStartup Script to write some JavaScript to the client that
slects the chosen value.

//Rutger
Nov 18 '05 #3
I was able to do this before without using JavaScript in .NET, i just can't
remember how i got it accomplished.

"Rutger Smit" wrote:
IGotYourDotNet wrote:
I have 2 drop downs on my screen the second one is displayed and populated
based on the selection of the first drop down.
The problem i'm having is that when a user selects something it keeps going
back to the first item in the list - in this case is Select Car.
How can I keep the users selection displayed in the drop down?

User RegisterStartup Script to write some JavaScript to the client that
slects the chosen value.

//Rutger

Nov 18 '05 #4
If your code to populate the dropdowns is in the Page_Load then make sure
you check for Postback or the initializing code will run everytime an event
posts back.

so do this (c#);

private void Page_Load
{
if(!IsPostBack)
{

//code to populate the dropdowns

}

}

That will prevent the code from reloading the dropdowns when you select from
the first dropdown.

Hope this helps,

Frank M.
"IGotYourDotNet " <IG************ @discussions.mi crosoft.com> wrote in message
news:4B******** *************** ***********@mic rosoft.com...
I have 2 drop downs on my screen the second one is displayed and populated
based on the selection of the first drop down.
The problem i'm having is that when a user selects something it keeps going back to the first item in the list - in this case is Select Car.
How can I keep the users selection displayed in the drop down?

Nov 18 '05 #5

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

Similar topics

5
5898
by: Jim Bo | last post by:
Hi, I have a drop down menu that is being populated by a query to the access database ---- Code --- Skill needed <SELECT size="1" NAME="SkillType" VALUE="SkillType"> <OPTION> <%=SkillType%>
46
5146
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") to populate a drop down but would like to use several drop downs restricting the contents of each drop down to the records pertaining to one
2
11062
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic SFSB and, from there, to the database. On the front end, all cells appear as text fields. However, for certain cells, when the user clicks on the cell, the text field turns into a drop-down field (i.e. Select object), defaulting to the value...
4
6316
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
2
2379
by: ramesh | last post by:
hi, I am using Com+ in my application. It will have InsertRecords,selectRecords,updateRecords function. In the Web Form i have Drop-down list. I want to select records from SQL and add it to this list. I know how to fill the data in the drop-down list. But i don't know how to pass this control to Com+. Do we need to pass like private FillList(Object e) {
13
5259
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
6
8307
by: mcgrew.michael | last post by:
I hope this is the right group. I am very new to ASP so this is probably a stupid question. I have some vbscript that query's AD and populates a recordset. I know the recorset contains the information I want by doing a Response.write. I am having problems dynamically creating a drop down list from the data in the recordset. The drop down is created but it is empty. Any help would be greatly appreciated. A sample of the code: <% 'On...
1
2967
by: student2008 | last post by:
Sorry about the title its a tricky one. I have a form which allows me to add a question and answers into a mysql database via a combination of, if a certain option is chosen and the reset button is pressed then a text box appears to enter a new question or answer or both. the newly entered data is then inserted into mysql. The newly entered data is then requested by mysql_fetch_array() to be displayed as options in the drop down list. If...
4
8465
by: bonneylake | last post by:
Hey Everyone, Well this is probably a pretty easy question, but for some reason i just can not figure it out. What i am trying to do is redisplay what was entered previously. I have figured everything out except for this drop down box. Right now i am using one cfoutput query to display in the drop down box the values for it that are in the database. However, now i created a second query to display what was entered previously. The thing...
3
5912
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 any misspelled words. Pretty common stuff using pspell. I display the new string so that the user...
0
9669
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
9515
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
10427
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
10207
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
9995
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
9029
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...
0
6776
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
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.