473,471 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

about request.querystring.

there is 3 links to page default.aspx,and each one has a querystring,like
a=1, b=1 ,c=1.

problem is how do i ensure the name of querystring!

how do?
May 22 '06 #1
4 2851
Hi Arvan,
Can you please brief the scenario?
--
Deepson Thomas
"Arvan" wrote:
there is 3 links to page default.aspx,and each one has a querystring,like
a=1, b=1 ,c=1.

problem is how do i ensure the name of querystring!

how do?

May 22 '06 #2
I quess u want to know which query string has come and from which page u
have been redirected
one way to know from which page u have been redirected is
Request.UrlReferrer.AbsolutePath;

otherwise

u can check values are not null like this

if((Request.QueryString["a"]!="")&&(Request.QueryString["a"]!=null)

{

string x=Request.QueryString["a"]

}

"Arvan" <es***@126.com> wrote in message
news:OB**************@TK2MSFTNGP03.phx.gbl...
there is 3 links to page default.aspx,and each one has a querystring,like
a=1, b=1 ,c=1.

problem is how do i ensure the name of querystring!

how do?

May 22 '06 #3
I am sorry.Well,i mean i have 3 pairs name/value collection.For example, at
default aspx page, i redirect to catalog.aspx?cataid=3 and at other code of
default.aspx redirect to catalog.aspx?catamr=1 .Right now how do i ensure
the name of querystring "cataid" or "catamr" at catalog.aspx.

if i can ensure the same , it could do something.

switch(.....)
case "cataid":
//do something about cataid
break;
case "catamr":
//do something about catamr
break;


May 22 '06 #4
Get the value of any querystring that you handle in the code:

string cataId, cataMr;
cataId = Request.QueryString["cataid"];
cataMr = Request.QueryString["catamr"];

Then check if the strings contain a value or not:

if (cataId != null) {
// handle cataid
}
if (cataMr != null) {
// handle catamr
}

or if they should be exclusive:

if (cataId != null) {
// handle cataid
} else if (cataMr != null) {
// handle catamr
}

Arvan wrote:
I am sorry.Well,i mean i have 3 pairs name/value collection.For example, at
default aspx page, i redirect to catalog.aspx?cataid=3 and at other code of
default.aspx redirect to catalog.aspx?catamr=1 .Right now how do i ensure
the name of querystring "cataid" or "catamr" at catalog.aspx.

if i can ensure the same , it could do something.

switch(.....)
case "cataid":
//do something about cataid
break;
case "catamr":
//do something about catamr
break;

May 22 '06 #5

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

Similar topics

5
by: momo | last post by:
Hello Newsgroup, I want to pass a Request.Form variable to an ASP form, through the url for example lets say i have a form with a textfiled called "txtName" if i click the submit button for...
0
by: Anders Borum | last post by:
Hello! I would like to request a new method on the XsltArgumentList class, allowing developers to check the presense of a key/value pair. If you try to add a key/value pair that has already been...
2
by: mahsa | last post by:
Hi have have some link like thi http://x.com/Shoppingcart.aspx?pn=ps50210&qty_ps50210=1&pn=excel&qty_excel=1&pn=l4504000&qty_l4504000=1&sku=PS50210&cat=laminate&action=updat now I want to request...
6
by: Steve B. | last post by:
Hello everybody In a webpage, I use JS display data from an xml file and a xsl file: var data = new ActiveXObject("Microsoft.XMLDOM"); data.async = false; var dataUrl = "data.aspx";...
6
by: Joe | last post by:
Hi, I have a MS Access DB in which a record has just too many fields to be able to allow users to do inline editing in a datagrid. So I want to display as First Name: Text box where first...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
3
by: Jeff | last post by:
Hey asp.net 2.0 (C#) Retriving value: In my webpage, I need to retrieve a value from the URL, this is a parameter stored in the url, like this: www.helloworld.com?testid=34 what C# code...
3
by: ebru | last post by:
about insert/delete/update records in mysql server with asp code how can I insert record in mysql database.. I insert into database but if I leave one text box empty, its give me error how can...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Make CStr for JavaScript on ASP w/ Request.Form and QueryString In ASP, Request.Form and Request.QueryString return objects that do not support "toString", or any JavaScript string...
0
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,...
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
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
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.