473,512 Members | 14,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting query info in a url

ASP.NET 2.0

I'm wondering how I can get a specific parameter in the query string in a
url. I have this url in my website:
Default.aspx?mode=1 So I'm wondering how I can the "mode" parameter and its
value.

I've seached the documentation I came across Uri.Query which returns the
entire query list in one single string (that is how I understand it). What
I'm looking for is method/property which returns the parameters as a
collection (name/value collection)

Any suggestions?
Feb 27 '07 #1
4 1121
Strange but just a few seconds after posting this question I came across
what I was looking for:
HttpRequest.QueryString
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u%****************@TK2MSFTNGP02.phx.gbl...
ASP.NET 2.0

I'm wondering how I can get a specific parameter in the query string in a
url. I have this url in my website:
Default.aspx?mode=1 So I'm wondering how I can the "mode" parameter and
its value.

I've seached the documentation I came across Uri.Query which returns the
entire query list in one single string (that is how I understand it). What
I'm looking for is method/property which returns the parameters as a
collection (name/value collection)

Any suggestions?

Feb 27 '07 #2
See Request.QueryString...

"Jeff" <it************@hotmail.com.NOSPAMa écrit dans le message de news:
u%****************@TK2MSFTNGP02.phx.gbl...
ASP.NET 2.0

I'm wondering how I can get a specific parameter in the query string in a
url. I have this url in my website:
Default.aspx?mode=1 So I'm wondering how I can the "mode" parameter and
its value.

I've seached the documentation I came across Uri.Query which returns the
entire query list in one single string (that is how I understand it). What
I'm looking for is method/property which returns the parameters as a
collection (name/value collection)

Any suggestions?

Feb 27 '07 #3
I'm wondering how I can get a specific parameter in the query string in a
url. I have this url in my website:
Default.aspx?mode=1 So I'm wondering how I can the "mode" parameter and
its value.
Multiple ways:

1. Request.QueryString["mode"]
2. Request["mode"]

However, note that while doing Request["mode"], we are looking at various
places at one go:
1. QueryString
2. Form-Data
3. Cookies
4. Headers
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
Feb 27 '07 #4
Just to help you bit more. Request is an namevaluecollection object in
asp.net and represents a set of objects you can query. As a collection it
can be iterated

The QueryString you have found on your own but there are other properties of
the request object that are equally useful, such as the Form,
ServerVariables, and Cookie collections.

Its worth reading a little about page execution to learn where various
elements become exposed.
http://msdn2.microsoft.com/en-us/library/aa479007.aspx

--
--
Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:ew**************@TK2MSFTNGP02.phx.gbl...
Strange but just a few seconds after posting this question I came across
what I was looking for:
HttpRequest.QueryString
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:u%****************@TK2MSFTNGP02.phx.gbl...
>ASP.NET 2.0

I'm wondering how I can get a specific parameter in the query string in a
url. I have this url in my website:
Default.aspx?mode=1 So I'm wondering how I can the "mode" parameter and
its value.

I've seached the documentation I came across Uri.Query which returns the
entire query list in one single string (that is how I understand it).
What I'm looking for is method/property which returns the parameters as a
collection (name/value collection)

Any suggestions?


Feb 27 '07 #5

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

Similar topics

3
2556
by: James | last post by:
Please help - getting very desperate! Sun, 12 October 2003 05:39 I have PHPDEV 4.2.3 from Firepages.com.au as the upgrade to 4.3.0 did not work. I also had an abortive download from PHP.NET as...
4
9154
by: Rajesh Kumar Mallah | last post by:
Hi, We need to implement following logic efficiently. SELECT * from some_table where .... IF rows_matched = 1 THEN use the single row that matched.
4
3382
by: New Guy | last post by:
I'm trying to work with a system that somebody else built and I am confounded by the following problem: There is a table of payments and a table of charges. Each client has charges and payments...
1
3872
by: Oleg Shnayderman | last post by:
Hi All, I am very new to C# as well as to SQL. I need to write an application which is connecting to SQL DB and getting all the user's tables and after create a dataset for all the tables in the...
4
5968
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
3
4965
by: wjreichard | last post by:
OK ... I am using UPS Worldship that issues an ODBC query to my MS2K server ... Worldship can query either a table or a view and retreive shipping info for a supplied orderid. I need to create a...
2
1720
by: sesling | last post by:
Our Database stores event messages in a table called eventnotifications. The table has a message type column. There are two types of messages (alert or info). I have created a form that includes a...
33
11809
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
9
1603
by: =?Utf-8?B?RGVubmlz?= | last post by:
I am trying to get all the user info in my home network domain using WMI but the below code returns nothing. I know the domain name I pass is correct, i.e., "mshome". I cut and pasted this code...
11
1441
by: Armin Zingler | last post by:
"Bill Schanks" <wschanks@gmail.comschrieb Try to execute lvMembers.beginupdate before filling and lvMembers.endupdate
0
7153
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...
0
7373
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
7432
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
7094
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
7519
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...
1
5079
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
4743
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
1585
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 ...
0
452
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...

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.