Connecting Tech Pros Worldwide Help | Site Map

Passing multiple query string params from datagrid hyperlink column

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 19th, 2005, 03:38 AM
bpschmid
Guest
 
Posts: n/a
Default 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?



  #2  
Old July 19th, 2005, 03:38 AM
Sonali.NET[MVP]
Guest
 
Posts: n/a
Default 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]

  #3  
Old July 19th, 2005, 03:39 AM
bpschmid
Guest
 
Posts: n/a
Default 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]
  #4  
Old July 19th, 2005, 03:39 AM
Sonali.NET[MVP]
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.