473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1181
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 RegisterStartupScript 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 RegisterStartupScript 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.microsoft.com> wrote in message
news:4B**********************************@microsof t.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
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>...
46
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") ...
2
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...
4
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...
2
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...
13
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...
6
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...
1
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...
4
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.