Setting Dropdown list on Page Load

Discussion in 'ASP General' started by jeffmagill@gmail.com, Mar 27, 2006.

  1. Guest

    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
    , Mar 27, 2006
    #1
    1. Advertising

  2. wrote:
    > 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.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Mar 27, 2006
    #2
    1. Advertising

  3. Guest

    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
    , Mar 27, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George
    Replies:
    1
    Views:
    440
    George
    Feb 1, 2004
  2. venky

    Page Load and webcontrol page load

    venky, Jul 6, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    3,101
    venky
    Jul 11, 2005
  3. Matcon
    Replies:
    3
    Views:
    21,574
    Matcon
    May 28, 2008
  4. M. Craig
    Replies:
    1
    Views:
    746
    Victor Garcia Aprea [MVP]
    Jan 9, 2004
  5. Palmi
    Replies:
    1
    Views:
    186
    PJ on Development
    Nov 8, 2007
Loading...

Share This Page