473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
3 3496
Im pretty sure you should check if Request.QueryString("key") = Null
On Tue, 27 Jan 2004 20:01:50 -0600, "Mark" <vb********@cableone.net>
wrote:
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 #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.com...
Im pretty sure you should check if Request.QueryString("key") = Null
On Tue, 27 Jan 2004 20:01:50 -0600, "Mark" <vb********@cableone.net>
wrote:
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 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 NameValueCollection (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
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...
1
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.