Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing multiple query string params from datagrid hyperlink column

bpschmid
Guest
 
Posts: n/a
#1: Jul 19 '05
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?



Sonali.NET[MVP]
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Passing multiple query string params from datagrid hyperlink column


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" <bpschmid@hotmail.com> wrote in message news:077f01c35a96$4ab620b0$a601280a@phx.gbl...[color=blue]
> 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?
>
> [/color]

bpschmid
Guest
 
Posts: n/a
#3: Jul 19 '05

re: Passing multiple query string params from datagrid hyperlink column


Thanks!

Do you have to use a template column?

[color=blue]
>-----Original Message-----
> Try
><asp:DataGrid id="DataGrid1" AutoGenerateColumns="False"[/color]
style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
79px" runat="server">[color=blue]
> <Columns>
> <asp:TemplateColumn HeaderText="Order">
> <ItemTemplate>
> <asp:Hyperlink runat="server" Text='<%[/color]
#DataBinder.Eval(Container.DataItem,"OrderID")%>'
NavigateUrl='<%# "page.aspx?Orderid=" + DataBinder.Eval
(Container.DataItem,"Orderid") + "&ProductID=" +
DataBinder.Eval(Container.DataItem,"ProductID")%>'
ID="Hyperlink1" NAME="Hyperlink1"/>[color=blue]
> </ItemTemplate>
> </asp:TemplateColumn>
> </Columns>
> </asp:DataGrid>
>Use & in case of Vb.NET
>HTH
>Regards
>Sushila
>..NET MVP
>
>
>
>"bpschmid" <bpschmid@hotmail.com> wrote in message[/color]
news:077f01c35a96$4ab620b0$a601280a@phx.gbl...[color=blue][color=green]
>> Ive got a datagrid with a hyperlink column.
>> I want to click on that column and go to another page,[/color][/color]
but[color=blue][color=green]
>> here's the kicker, I need and want to pass not one, but
>> two different query string parameters and format[/color][/color]
strings[color=blue][color=green]
>> from 2 different bound columns. I know I could do this
>> using session variables, but I really want to do it[/color][/color]
using[color=blue][color=green]
>> query string parameters. Anyone know a way to do this?
>>
>>[/color]
>[/color]
Sonali.NET[MVP]
Guest
 
Posts: n/a
#4: Jul 19 '05

re: Passing multiple query string params from datagrid hyperlink column


To pass 2 variable you wud use template column

"bpschmid" <bpschmid@hotmail.com> wrote in message
news:02c001c35ab3$bd039400$a301280a@phx.gbl...[color=blue]
> Thanks!
>
> Do you have to use a template column?
>
>[color=green]
> >-----Original Message-----
> > Try
> ><asp:DataGrid id="DataGrid1" AutoGenerateColumns="False"[/color]
> style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
> 79px" runat="server">[color=green]
> > <Columns>
> > <asp:TemplateColumn HeaderText="Order">
> > <ItemTemplate>
> > <asp:Hyperlink runat="server" Text='<%[/color]
> #DataBinder.Eval(Container.DataItem,"OrderID")%>'
> NavigateUrl='<%# "page.aspx?Orderid=" + DataBinder.Eval
> (Container.DataItem,"Orderid") + "&ProductID=" +
> DataBinder.Eval(Container.DataItem,"ProductID")%>'
> ID="Hyperlink1" NAME="Hyperlink1"/>[color=green]
> > </ItemTemplate>
> > </asp:TemplateColumn>
> > </Columns>
> > </asp:DataGrid>
> >Use & in case of Vb.NET
> >HTH
> >Regards
> >Sushila
> >..NET MVP
> >
> >
> >
> >"bpschmid" <bpschmid@hotmail.com> wrote in message[/color]
> news:077f01c35a96$4ab620b0$a601280a@phx.gbl...[color=green][color=darkred]
> >> Ive got a datagrid with a hyperlink column.
> >> I want to click on that column and go to another page,[/color][/color]
> but[color=green][color=darkred]
> >> here's the kicker, I need and want to pass not one, but
> >> two different query string parameters and format[/color][/color]
> strings[color=green][color=darkred]
> >> from 2 different bound columns. I know I could do this
> >> using session variables, but I really want to do it[/color][/color]
> using[color=green][color=darkred]
> >> query string parameters. Anyone know a way to do this?
> >>
> >>[/color]
> >[/color][/color]


Closed Thread