473,811 Members | 2,971 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
3 3513
Im pretty sure you should check if Request.QuerySt ring("key") = Null
On Tue, 27 Jan 2004 20:01:50 -0600, "Mark" <vb********@cab leone.net>
wrote:
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 #2
Hmm, that doesnt work in vb.net

I've even tried checking for it to be nothing because in the command window
that is what it says it returns, but when checking in code it errors out

"Dan Brussee" <db******@nc.rr .com> wrote in message
news:7c******** *************** *********@4ax.c om...
Im pretty sure you should check if Request.QuerySt ring("key") = Null
On Tue, 27 Jan 2004 20:01:50 -0600, "Mark" <vb********@cab leone.net>
wrote:
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 anerror there has to be an easier way then having to put all the checks in atry catch statement
Thanks
Mark

Nov 18 '05 #3
QueryString is an implementation of NameValueCollec tion (http://msdn.microsoft.com/library/de...berstopic.asp). you can loop through it and extract the querystring vars one by one using the Count property and use them that way, or test each value to see if it's length is <=0, or == to String.Empty... et

ht
jayson
Nov 18 '05 #4

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

Similar topics

3
4641
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
18104
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");
1
1578
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
15898
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
1655
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
2208
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
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
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
10392
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...
1
10403
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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
7671
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
5555
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...
1
4341
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 we have to send another system
3
3020
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.