473,513 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

request.querystring

I just started with Visual Web Developer, and see if you can help me out
with this. I want to generate a gridview from a table in a database and
each of the rows will be linked to the same page with the exception that the
URL has a variable in it. I know how to retrieve the variable in ASP.NET
from the URL but how do I setup the GridView to have every row be linked to
something like this:

If the row contains "Sacremento" it should be linked to
http://domain/Default.aspx?city=Sacramento.
For the row containing "Fresno" it should be linked to
http://domain/Default.aspx?city=Fresno.

is there a way of automating this?

Right now I'm thinking the Grid will be the result of a SELECT city FROM
states.dbo.citylevel SQL query.

Thanks,
--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com
Aug 28 '07 #1
4 1674
Hi Luke,
try to use a HyperLinkColumn liek the code below:

<Columns>
<asp:HyperLinkField DataNavigateUrlFields="City"
DataNavigateUrlFormatString="http://domain/Default.aspx?city={0}"
DataTextField="City" />
</Columns>

once you bind the datatable to this gridview, it will have a link with only
the city changing.

I hope it helps,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I just started with Visual Web Developer, and see if you can help me out
with this. I want to generate a gridview from a table in a database and
each of the rows will be linked to the same page with the exception that
the URL has a variable in it. I know how to retrieve the variable in
ASP.NET from the URL but how do I setup the GridView to have every row be
linked to something like this:

If the row contains "Sacremento" it should be linked to
http://domain/Default.aspx?city=Sacramento.
For the row containing "Fresno" it should be linked to
http://domain/Default.aspx?city=Fresno.

is there a way of automating this?

Right now I'm thinking the Grid will be the result of a SELECT city FROM
states.dbo.citylevel SQL query.

Thanks,
--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com


Aug 29 '07 #2
That's exactly what I was looking for. And if I want to add in more
information into the URL that is in that table, such as state, which is also
databound, how would I do that? (For example the column in the db table is
called "state" and that is shown as well)

Thanks again, that makes sense.


"Bruno Piovan" <brunopiovan AT gmail DOT com (NOSPAM!)wrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi Luke,
try to use a HyperLinkColumn liek the code below:

<Columns>
<asp:HyperLinkField DataNavigateUrlFields="City"
DataNavigateUrlFormatString="http://domain/Default.aspx?city={0}"
DataTextField="City" />
</Columns>

once you bind the datatable to this gridview, it will have a link with
only the city changing.

I hope it helps,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I just started with Visual Web Developer, and see if you can help me out
with this. I want to generate a gridview from a table in a database and
each of the rows will be linked to the same page with the exception that
the URL has a variable in it. I know how to retrieve the variable in
ASP.NET from the URL but how do I setup the GridView to have every row be
linked to something like this:

If the row contains "Sacremento" it should be linked to
http://domain/Default.aspx?city=Sacramento.
For the row containing "Fresno" it should be linked to
http://domain/Default.aspx?city=Fresno.

is there a way of automating this?

Right now I'm thinking the Grid will be the result of a SELECT city FROM
states.dbo.citylevel SQL query.

Thanks,
--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com



Aug 29 '07 #3
try to add the columns you'll use in the url, and then use the parameters in
the DataNavigateUrlFormatString starting from zero, example:

DataNavigateUrlFields = "city,state"
DataNavigateUrlFormatString =
"http://domain/Default.aspx?city={0}&state={1}"

Let me know if it works,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:eJ**************@TK2MSFTNGP04.phx.gbl...
That's exactly what I was looking for. And if I want to add in more
information into the URL that is in that table, such as state, which is
also databound, how would I do that? (For example the column in the db
table is called "state" and that is shown as well)

Thanks again, that makes sense.


"Bruno Piovan" <brunopiovan AT gmail DOT com (NOSPAM!)wrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Hi Luke,
try to use a HyperLinkColumn liek the code below:

<Columns>
<asp:HyperLinkField DataNavigateUrlFields="City"
DataNavigateUrlFormatString="http://domain/Default.aspx?city={0}"
DataTextField="City" />
</Columns>

once you bind the datatable to this gridview, it will have a link with
only the city changing.

I hope it helps,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>>I just started with Visual Web Developer, and see if you can help me out
with this. I want to generate a gridview from a table in a database and
each of the rows will be linked to the same page with the exception that
the URL has a variable in it. I know how to retrieve the variable in
ASP.NET from the URL but how do I setup the GridView to have every row be
linked to something like this:

If the row contains "Sacremento" it should be linked to
http://domain/Default.aspx?city=Sacramento.
For the row containing "Fresno" it should be linked to
http://domain/Default.aspx?city=Fresno.

is there a way of automating this?

Right now I'm thinking the Grid will be the result of a SELECT city FROM
states.dbo.citylevel SQL query.

Thanks,
--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com




Aug 29 '07 #4
Works great.

"Bruno Piovan" <brunopiovan AT gmail DOT com (NOSPAM!)wrote in message
news:Op**************@TK2MSFTNGP02.phx.gbl...
try to add the columns you'll use in the url, and then use the parameters
in the DataNavigateUrlFormatString starting from zero, example:

DataNavigateUrlFields = "city,state"
DataNavigateUrlFormatString =
"http://domain/Default.aspx?city={0}&state={1}"

Let me know if it works,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:eJ**************@TK2MSFTNGP04.phx.gbl...
>That's exactly what I was looking for. And if I want to add in more
information into the URL that is in that table, such as state, which is
also databound, how would I do that? (For example the column in the db
table is called "state" and that is shown as well)

Thanks again, that makes sense.


"Bruno Piovan" <brunopiovan AT gmail DOT com (NOSPAM!)wrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>Hi Luke,
try to use a HyperLinkColumn liek the code below:

<Columns>
<asp:HyperLinkField DataNavigateUrlFields="City"
DataNavigateUrlFormatString="http://domain/Default.aspx?city={0}"
DataTextField="City" />
</Columns>

once you bind the datatable to this gridview, it will have a link with
only the city changing.

I hope it helps,
Bruno

"Luke Davis" <lu**@gorealco.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl.. .
I just started with Visual Web Developer, and see if you can help me out
with this. I want to generate a gridview from a table in a database
and each of the rows will be linked to the same page with the exception
that the URL has a variable in it. I know how to retrieve the variable
in ASP.NET from the URL but how do I setup the GridView to have every
row be linked to something like this:

If the row contains "Sacremento" it should be linked to
http://domain/Default.aspx?city=Sacramento.
For the row containing "Fresno" it should be linked to
http://domain/Default.aspx?city=Fresno.

is there a way of automating this?

Right now I'm thinking the Grid will be the result of a SELECT city
FROM states.dbo.citylevel SQL query.

Thanks,
--
Luke Davis, MCSE: Security
DEM Networks - Senior Systems Architect
7225 N First, Suite 105
Fresno, CA 93720
Office: 1 (559) 439-1000
Fax: 1 (866) 640-2041
www.demnetworks.com




Aug 29 '07 #5

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

Similar topics

5
2555
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...
4
2724
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
5
2391
by: Ivan | last post by:
hi, I saw some program using "request("fieldname") " instead of "request.QueryString" to get the value from URL, what's the different ?? thanks
0
3080
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...
1
1865
by: FD | last post by:
For performance reason, the follwoing code (C#) to capture all the Request collection contexts is NOT recommended: string ID = Request.QueryString; But how to Capture the individual Request...
4
13178
by: Steve | last post by:
Hi- I'd like to set values in the QueryString if I detect that a user submits a bad value, say... ?id=333 where there is no id '333', I would like to set it to '0' for example. I tried to use...
2
1831
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...
4
25338
by: Guoqi Zheng | last post by:
On my application, I need to have different action based on the pass in query string. When the query string is not presented, I try to use If request.querystring("id") ="" THEN ...... This is...
6
3785
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
7
9645
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
7260
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
7161
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
7384
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
7539
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...
0
7525
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
5686
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,...
0
4746
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
1596
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
456
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.