Passing multiple query string params from datagrid hyperlink column

Discussion in 'Microsoft Dot NET' started by bpschmid, Aug 4, 2003.

  1. bpschmid

    bpschmid Guest

    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?
     
    bpschmid, Aug 4, 2003
    #1
    1. Advertisements

  2. 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" <> wrote in message news:077f01c35a96$4ab620b0$...
    > 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], Aug 4, 2003
    #2
    1. Advertisements

  3. bpschmid

    bpschmid Guest

    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" <> wrote in message

    news:077f01c35a96$4ab620b0$...
    >> 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?
    >>
    >>

    >
     
    bpschmid, Aug 4, 2003
    #3
  4. To pass 2 variable you wud use template column

    "bpschmid" <> wrote in message
    news:02c001c35ab3$bd039400$...
    > 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" <> wrote in message

    > news:077f01c35a96$4ab620b0$...
    > >> 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], Aug 4, 2003
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul
    Replies:
    1
    Views:
    505
    Ali Sanjabi
    Jul 7, 2003
  2. spammy

    Interop and not passing optional out params

    spammy, May 25, 2004, in forum: Microsoft Dot NET
    Replies:
    6
    Views:
    228
    Jon Skeet [C# MVP]
    May 25, 2004
  3. Marc Miller

    how to open new window with params

    Marc Miller, Jan 13, 2005, in forum: Microsoft Dot NET
    Replies:
    1
    Views:
    137
    Greg Burns
    Jan 13, 2005
  4. Programmer

    Windows Forms Control In aspx & Params

    Programmer, Jul 14, 2005, in forum: Microsoft Dot NET
    Replies:
    0
    Views:
    149
    Programmer
    Jul 14, 2005
  5. Guest
    Replies:
    1
    Views:
    148
    Cor Ligthert [MVP]
    Jul 26, 2005
Loading...

Share This Page