473,799 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

httpRequest.que rystring

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
Nov 18 '05 #1
1 1576
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" <vb********@cab leone.net> wrote in message
news:eG******** *****@TK2MSFTNG P12.phx.gbl...
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


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
4640
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); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { document.myForm.outputSource.value = xmlhttp.responseText; } }
1
4890
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 or so ago everything was working fine. I honestly can't remember changing anything since it was last working. But I tried reinstalling the .Net Framework along w/ the service pack, which didn't work. I also had v1.1 already installed but I hadn't...
2
18097
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 key ID. When I execute the code below I am getting the entire URL and not just the value of the key ID. Any suggestions? string idValue = Request.Params.Get("ID");
3
3513
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 there I get an error there has to be an easier way then having to put all the checks in a try catch statement
11
15896
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 session xfer to work, possibly due to the cookies not being compatible. I've spent over a week trying to get the HWR to integrate nicely with my app, but I cannot get the session to transfer, and it'd probably take me even longer if I tried to digest...
1
1654
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" /> </form> What is the value of Request server side? Experiment shows that GET overwrites POST which overwrites the cookie. Is this documented
1
2207
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 results for similar problems: --------------------------------------------------------- Exception Details: System.Web.HttpException: Request is not available in this context Source Error: Line 48: Public Sub Run() Line 49: Line 50: ...
1
2851
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 HttpRequest constructors and cannot see how to use it. public HttpRequest ( string filename, string url,
2
3181
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 that XML string from QueryString, however, the "+" appears as a " " (space), not a "+". I have tried the following: NameValueCollection coll = Request.QueryString; XMLstring = coll.Get("XMLstr"); // result: XMLstring = "<age>8 </age>"
0
9688
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10491
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7571
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.