Setting Dropdown list on Page Load

J

jeffmagill

Hello everyone,

I have what I thought was a simple script but I cant figure it out.
Anyway, I want to set the selected item of a drop down list with
information i am recieving from request.querystring. Seems like this is
a case of when learning asp.net first is a hindrance to what i want to
do. Im looking for something to the effect of,

Request.Form("dd_eventdate")= Request.QueryString("event")

thanks,

jeff
 
B

Bob Barrows [MVP]

Hello everyone,

I have what I thought was a simple script but I cant figure it out.
Anyway, I want to set the selected item of a drop down list with
information i am recieving from request.querystring. Seems like this
is a case of when learning asp.net first is a hindrance to what i
want to do. Im looking for something to the effect of,

Request.Form("dd_eventdate")= Request.QueryString("event")

thanks,
I'm not clear. Are you doning this in classic asp or asp.net?
FWIW, what you've written is not valid even in asp.net: the Request
collections are read-only.

Classic ASP answer:
Remember, asp code generates html that is sent to the client via the
Response object. Other than that (and the Request object of course) there is
no interaction with the client.
It appears you have a SELECT element whose name is "dd_eventdate" ... how is
the list of options for the SELECT generated/populated? If it's done using
server-side code, then you should incorporate the querystring variable's
value into the code building that option list.
If it is hard-coded or built via client-side code, then you will need to use
client-side script to select the option. That, of course, is outside the
purview of this newsgroup - try .scripting.jscript.
 
J

jeffmagill

Thank Bob. I realize that the code I posted was not valid anywhere
(except my brain maybe) but I was just trying to convey what I was
trying to accomplish. Yes, Im using classic ASP, and yes, you answered
my question. Sorry for being vague and thanks for your help!

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top