473,386 Members | 1,715 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,386 software developers and data experts.

Passing multiple query string params from datagrid hyperlink column

Ive got a datagrid with a hyperlink column.
I want to click on that column and go to another page, but
here's the kicker, I need and want to pass not one, but
two different query string parameters and format strings
from 2 different bound columns. I know I could do this
using session variables, but I really want to do it using
query string parameters. Anyone know a way to do this?
Jul 19 '05 #1
3 45025
Try
<asp:DataGrid id="DataGrid1" AutoGenerateColumns="False" style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Order">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Order ID")%>' NavigateUrl='<%# "page.aspx?Orderid=" + DataBinder.Eval(Container.DataItem,"Orderid") + "&ProductID=" + DataBinder.Eval(Container.DataItem,"ProductID")%>' ID="Hyperlink1" NAME="Hyperlink1"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Use & in case of Vb.NET
HTH
Regards
Sushila
..NET MVP

"bpschmid" <bp******@hotmail.com> wrote in message news:07****************************@phx.gbl...
Ive got a datagrid with a hyperlink column.
I want to click on that column and go to another page, but
here's the kicker, I need and want to pass not one, but
two different query string parameters and format strings
from 2 different bound columns. I know I could do this
using session variables, but I really want to do it using
query string parameters. Anyone know a way to do this?



Jul 19 '05 #2
Thanks!

Do you have to use a template column?

-----Original Message-----
Try
<asp:DataGrid id="DataGrid1" AutoGenerateColumns="False" style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
79px" runat="server"> <Columns>
<asp:TemplateColumn HeaderText="Order">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<% #DataBinder.Eval(Container.DataItem,"OrderID")%>'
NavigateUrl='<%# "page.aspx?Orderid=" + DataBinder.Eval
(Container.DataItem,"Orderid") + "&ProductID=" +
DataBinder.Eval(Container.DataItem,"ProductID")%>'
ID="Hyperlink1" NAME="Hyperlink1"/> </ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Use & in case of Vb.NET
HTH
Regards
Sushila
..NET MVP

"bpschmid" <bp******@hotmail.com> wrote in message

news:07****************************@phx.gbl...
Ive got a datagrid with a hyperlink column.
I want to click on that column and go to another page, but here's the kicker, I need and want to pass not one, but
two different query string parameters and format strings from 2 different bound columns. I know I could do this
using session variables, but I really want to do it using query string parameters. Anyone know a way to do this?

Jul 19 '05 #3
To pass 2 variable you wud use template column

"bpschmid" <bp******@hotmail.com> wrote in message
news:02****************************@phx.gbl...
Thanks!

Do you have to use a template column?

-----Original Message-----
Try
<asp:DataGrid id="DataGrid1" AutoGenerateColumns="False"

style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
79px" runat="server">
<Columns>
<asp:TemplateColumn HeaderText="Order">
<ItemTemplate>
<asp:Hyperlink runat="server" Text='<%

#DataBinder.Eval(Container.DataItem,"OrderID")%>'
NavigateUrl='<%# "page.aspx?Orderid=" + DataBinder.Eval
(Container.DataItem,"Orderid") + "&ProductID=" +
DataBinder.Eval(Container.DataItem,"ProductID")%>'
ID="Hyperlink1" NAME="Hyperlink1"/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
Use & in case of Vb.NET
HTH
Regards
Sushila
..NET MVP

"bpschmid" <bp******@hotmail.com> wrote in message

news:07****************************@phx.gbl...
Ive got a datagrid with a hyperlink column.
I want to click on that column and go to another page, but here's the kicker, I need and want to pass not one, but
two different query string parameters and format strings from 2 different bound columns. I know I could do this
using session variables, but I really want to do it using query string parameters. Anyone know a way to do this?

Jul 19 '05 #4

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

Similar topics

1
by: Amy | last post by:
All, I'd like to use multiple querystring in hyperlink column in Datagrid I want to create a hyperlink column in my datagrid which contains two query strings ex:...
10
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use :...
1
by: Coder Coder | last post by:
Hi I want the DataNavigateUrlFormatString value to be of a couple of different variables such as: DataNavigateUrlFormatString="mypage?val={0}&val2={1} where now I have the following...
2
by: Carl Howarth | last post by:
Hi, I need to bind data to a datagrid and have a custom hyperlink column that has multiple elements in the querystring: Page.aspx?1=Hello&2=Goodbye... The query string needs to be populated...
1
by: Greg Reynolds | last post by:
Hi, I need to create datagrid hyperlink columns with multiple parameters in the URL. In my research on how to do this, it is recommended to create a template column which I have done. The code...
1
by: carlor | last post by:
Hi there, I have a datagrid that is bound to a datasource. The grid has a hyperlink column and I want to generate the URL using the URL Field and URL Format String fields in the Property...
1
by: Roy | last post by:
I'm assuming this is amazingly simple and I'm just missing the boat. On the html side of an asp.net page I have a datagrid, a "search" button, and 8 text boxes for search criteria. A user enters...
3
by: bpschmid | last post by:
Ive got a datagrid with a hyperlink column. I want to click on that column and go to another page, but here's the kicker, I need and want to pass not one, but two different query string parameters...
1
by: dhanlak | last post by:
I am doing a asp.net Project, in which i need to populate a datagrid using a stored procedure. The stored procedure returns different column names based on the user input, but the no of columns(it...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.