469,270 Members | 1,106 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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 44747
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Amy | last post: by
1 post views Thread by Coder Coder | last post: by
2 posts views Thread by Carl Howarth | last post: by
1 post views Thread by Greg Reynolds | last post: by
1 post views Thread by carlor | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.