newbie querystring question

Discussion in 'ASP General' started by middletree, Oct 8, 2003.

  1. middletree

    middletree Guest

    OK, I'm not a newbie, but I have only used Get method, never used Post or
    Session variables. I have used hidden fields to pass data from one page to
    the next, and it has worked fine. However, I have a situation where I will
    need to use querystrings in an Intranet app (to have a clickable link in an
    email which will be sent).

    So I posted a question about querystrings last week, and think I get it, but
    I don't want to have to change my other ASP pages which could also direct
    the user to this one page. So I was thinking about keep those pages the
    same, and then putting this pseudo code in the targeted page:

    If (querystring <> "" then
    strVariablename = Request.querystring (whatever)
    Else
    strVariablename = Request.Form(whatever)
    End if

    So the page could be usable if it were

    http://intranet/ShowAllInfo.asp

    or

    http://intranet/ShowAllInfo.asp?Ticket=111

    Will such a mixed environment work?
     
    middletree, Oct 8, 2003
    #1
    1. Advertising

  2. middletree

    Ray at Guest

    Yes, this CAN work. Just make sure you have your logic right. Like, what
    if someone goes to showallinfo.asp?kajsdlfkjasljfa? The querystring <> ""
    then, but there is no value for the value you're looking for.

    Also, you could consider using Request.ServerVariables("REQUEST_METHOD") to
    aid your page in deciding where it should define its data from.

    Ray at work

    "middletree" <> wrote in message
    news:...
    > OK, I'm not a newbie, but I have only used Get method, never used Post or
    > Session variables. I have used hidden fields to pass data from one page

    to
    > the next, and it has worked fine. However, I have a situation where I will
    > need to use querystrings in an Intranet app (to have a clickable link in

    an
    > email which will be sent).
    >
    > So I posted a question about querystrings last week, and think I get it,

    but
    > I don't want to have to change my other ASP pages which could also direct
    > the user to this one page. So I was thinking about keep those pages the
    > same, and then putting this pseudo code in the targeted page:
    >
    > If (querystring <> "" then
    > strVariablename = Request.querystring (whatever)
    > Else
    > strVariablename = Request.Form(whatever)
    > End if
    >
    > So the page could be usable if it were
    >
    > http://intranet/ShowAllInfo.asp
    >
    > or
    >
    > http://intranet/ShowAllInfo.asp?Ticket=111
    >
    > Will such a mixed environment work?
    >
    >
     
    Ray at, Oct 8, 2003
    #2
    1. Advertising

  3. middletree

    middletree Guest

    Thanks. I'll have to look into both suggestions. Need to research the second
    one, as I've never seen that before.


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:##...
    > Yes, this CAN work. Just make sure you have your logic right. Like, what
    > if someone goes to showallinfo.asp?kajsdlfkjasljfa? The querystring <> ""
    > then, but there is no value for the value you're looking for.
    >
    > Also, you could consider using Request.ServerVariables("REQUEST_METHOD")

    to
    > aid your page in deciding where it should define its data from.
    >
    > Ray at work
    >
    > "middletree" <> wrote in message
    > news:...
    > > OK, I'm not a newbie, but I have only used Get method, never used Post

    or
    > > Session variables. I have used hidden fields to pass data from one page

    > to
    > > the next, and it has worked fine. However, I have a situation where I

    will
    > > need to use querystrings in an Intranet app (to have a clickable link in

    > an
    > > email which will be sent).
    > >
    > > So I posted a question about querystrings last week, and think I get it,

    > but
    > > I don't want to have to change my other ASP pages which could also

    direct
    > > the user to this one page. So I was thinking about keep those pages the
    > > same, and then putting this pseudo code in the targeted page:
    > >
    > > If (querystring <> "" then
    > > strVariablename = Request.querystring (whatever)
    > > Else
    > > strVariablename = Request.Form(whatever)
    > > End if
    > >
    > > So the page could be usable if it were
    > >
    > > http://intranet/ShowAllInfo.asp
    > >
    > > or
    > >
    > > http://intranet/ShowAllInfo.asp?Ticket=111
    > >
    > > Will such a mixed environment work?
    > >
    > >

    >
    >
     
    middletree, Oct 8, 2003
    #3
  4. middletree

    Robert May Guest

    What you've stated will work, but you might try the following:

    value=Request("variableName")

    You do get a penalty for this because it needs to search through basically
    all of the collections in the Request object to find the variable name, but
    in practice, it's never been a problem.

    Robert

    "middletree" <> wrote in message
    news:...
    > OK, I'm not a newbie, but I have only used Get method, never used Post or
    > Session variables. I have used hidden fields to pass data from one page

    to
    > the next, and it has worked fine. However, I have a situation where I will
    > need to use querystrings in an Intranet app (to have a clickable link in

    an
    > email which will be sent).
    >
    > So I posted a question about querystrings last week, and think I get it,

    but
    > I don't want to have to change my other ASP pages which could also direct
    > the user to this one page. So I was thinking about keep those pages the
    > same, and then putting this pseudo code in the targeted page:
    >
    > If (querystring <> "" then
    > strVariablename = Request.querystring (whatever)
    > Else
    > strVariablename = Request.Form(whatever)
    > End if
    >
    > So the page could be usable if it were
    >
    > http://intranet/ShowAllInfo.asp
    >
    > or
    >
    > http://intranet/ShowAllInfo.asp?Ticket=111
    >
    > Will such a mixed environment work?
    >
    >
     
    Robert May, Oct 8, 2003
    #4
  5. middletree

    Adrienne Guest

    Gazing into my crystal ball I observed "Robert May"
    <> writing in
    news::

    > What you've stated will work, but you might try the following:
    >
    > value=Request("variableName")
    >
    > You do get a penalty for this because it needs to search through
    > basically all of the collections in the Request object to find the
    > variable name, but in practice, it's never been a problem.
    >


    You'll run into problems if it's one of the ServerVariables, like URL.
    <input type="text" name="url" id="url" value="<%=request("url")%>" /> will
    return the name of the page.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
     
    Adrienne, Oct 9, 2003
    #5
    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. Derrick
    Replies:
    6
    Views:
    4,118
    navyjax2
    Nov 28, 2011
  2. Mehdi
    Replies:
    6
    Views:
    36,255
    sloan
    Apr 6, 2006
  3. Jeff
    Replies:
    5
    Views:
    385
  4. .nLL
    Replies:
    4
    Views:
    1,575
  5. Adeel Ahmad
    Replies:
    1
    Views:
    583
    Anthony Jones
    Mar 7, 2006
Loading...

Share This Page