473,463 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

httpRequest.querystring

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

I.E. If request.querystring("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
Nov 18 '05 #1
1 1536
If request.querystring("key") is nothing then
Or
If Not request.querystring("key") is nothing then
or if the key exists but has no value set
try
if not request.querystring("key").toString.trim.length 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" <vb********@cableone.net> wrote in message
news:eG*************@TK2MSFTNGP12.phx.gbl...
Hello
Can anyone tell me how to check if a a querystring is present or not

I.E. If request.querystring("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


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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: HikksNotAtHome | last post by:
In Mozilla 1.4b, when the URL is set to a local URL, it works as expected. function showIt(){ var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "blank.html" ,true);...
1
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day...
2
by: Kevin | last post by:
I am attempting to fetch the value of a paramter passed in on the http request url. Example: http://localhost.mypage.aspx?ID=12345 In the URL above I am wanting to retrieve the value of the...
3
by: Mark | last post by:
Hello Can anyone tell me how to check if a a querystring is present or not I.E. If request.querystring("key") is in the url or not because when i try to reference it in anyway and its not...
11
by: Keith Patrick | last post by:
Could someone explain to me the relationship between these two classes? I am ripping my hair out trying to divert an HttpRequest to a new location via an HttpWebRequest, but I cannot get my...
1
by: ken.prat | last post by:
Given the following: <script>document.cookie = "foo=cookie;";</script> <form action="form.aspx?foo=query" method="post"> <input name="foo" type="hidden" value="fom" /> <input type="submit" />...
1
by: dlong | last post by:
I am attempting to use a simple querystring passed from a VB application into my aspx page, ASP .NET 2.0. The following error appears no matter how it is arranged as suggested in the forum search...
1
by: Jeff | last post by:
ASP.NET 2.0 I'm about to program a HttpRequest from my asp.net 2.0 website. I'll request another server using HttpRequest and ask if password etc are okay.... So I've looked into the...
2
by: zman77 | last post by:
I have a problem with HttpRequest.QueryString. There is an XML string that contains something like the following: <age>8+</age> As you probably guessed, the "+" is the problem :) I want to get...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.