473,412 Members | 2,051 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,412 software developers and data experts.

To find if particular url variable exists?

I'm retrieving url variable information uses the Request.QueryString object,
eg:

if (Request.QueryString.HasKeys())
key
{
lblMyResult.Text = Request.QueryString["myVar"];
}
else
{
lblMyResult.Text = "Var does not exist";
}

Request.QueryString.HasKeys() tells me if there are _any_ keys, how can I
find if one particular key exists (without cycling over all keys and
checking their names one by one)?

Thanks

Lauchlan M
Nov 17 '05 #1
2 1693
if (Request.QueryString["MyVar"] != null)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Lauchlan M" <LM********@Hotmail.com> wrote in message
news:OG**************@TK2MSFTNGP12.phx.gbl...
I'm retrieving url variable information uses the Request.QueryString object, eg:

if (Request.QueryString.HasKeys())
key
{
lblMyResult.Text = Request.QueryString["myVar"];
}
else
{
lblMyResult.Text = "Var does not exist";
}

Request.QueryString.HasKeys() tells me if there are _any_ keys, how can I
find if one particular key exists (without cycling over all keys and
checking their names one by one)?

Thanks

Lauchlan M

Nov 17 '05 #2

Thx!

I'll try that.

Lauchlan M
if (Request.QueryString["MyVar"] != null)

--
HTH,

Kevin Spencer

Nov 17 '05 #3

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

Similar topics

0
by: jeremit0 | last post by:
I have read a text file using the command lines = myfile.readlines() and now I want to seach those lines for a particular string. I was hoping there was a way to "find" that string in a...
6
by: jrpfinch | last post by:
I have a table with two columns: siteID (int primary key) and siteName (varchar(50) unique constraint). I am completely new to databases and UDFs and would like to write a function that looks...
2
by: keeps21 | last post by:
I have a script that recieves an id number via the address bar when a link is clicked. ie . index.php?id=1 if the link was for the story whose ID is 1. My script checks if a user is logged in,...
0
by: Gabriel Genellina | last post by:
En Wed, 20 Aug 2008 17:10:15 -0300, aditya shukla <adityashukla1983@gmail.comescribió: You have 3 leading underscores in __main__ so the if statement is skipped and nothing happens. I'd use the...
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...
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
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
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...
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...

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.