httpRequest.querystring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark

    httpRequest.querystring

    Hello
    Can anyone tell me how to check if a a querystring is present or not

    I.E. If request.queryst ring("key") is in the url or not

    because when i try to reference it in anyway and its not there I get an
    error there has to be an easier way then having to put all the checks in a
    try catch statement


    Thanks
    Mark


  • noone

    #2
    Re: httpRequest.que rystring

    If request.queryst ring("key") is nothing then
    Or
    If Not request.queryst ring("key") is nothing then
    or if the key exists but has no value set
    try
    if not request.queryst ring("key").toS tring.trim.leng th then
    DOntdothis()
    end if
    ' this always throws an exception with a null value or of course you can jus
    return dothis()
    Catch ex as exception
    return Dontdothis()
    end try

    Actually you hit on the simplest way to do it, if you need to tell the user
    what is wrong this also works great with a custom validator.
    try
    catch ex as exception
    finally
    end try
    Put the code to handle things without the proper key into catch.
    "Mark" <vbrenegade@cab leone.net> wrote in message
    news:eGs9ZMU5DH A.632@TK2MSFTNG P12.phx.gbl...[color=blue]
    > Hello
    > Can anyone tell me how to check if a a querystring is present or not
    >
    > I.E. If request.queryst ring("key") is in the url or not
    >
    > because when i try to reference it in anyway and its not there I get[/color]
    an[color=blue]
    > error there has to be an easier way then having to put all the checks in a
    > try catch statement
    >
    >
    > Thanks
    > Mark
    >
    >[/color]



    x-- 100 Proof News - http://www.100ProofNews.com
    x-- 3,500+ Binary NewsGroups, and over 90,000 other groups
    x-- Access to over 800 Gigs/Day - $8.95/Month
    x-- UNLIMITED DOWNLOAD

    Comment

    Working...