Passing multiple query string params from datagrid hyperlink column

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bpschmid

    #1

    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?


  • Sonali.NET[MVP]

    #2
    Re: Passing multiple query string params from datagrid hyperlink column

    Try
    <asp:DataGrid id="DataGrid1" AutoGenerateCol umns="False" style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP: 79px" runat="server">
    <Columns>
    <asp:TemplateCo lumn HeaderText="Ord er">
    <ItemTemplate >
    <asp:Hyperlin k runat="server" Text='<%#DataBi nder.Eval(Conta iner.DataItem," OrderID")%>' NavigateUrl='<% # "page.aspx?Orde rid=" + DataBinder.Eval (Container.Data Item,"Orderid") + "&ProductID =" + DataBinder.Eval (Container.Data Item,"ProductID ")%>' ID="Hyperlink1 " NAME="Hyperlink 1"/>
    </ItemTemplate>
    </asp:TemplateCol umn>
    </Columns>
    </asp:DataGrid>
    Use & in case of Vb.NET
    HTH
    Regards
    Sushila
    ..NET MVP



    "bpschmid" <bpschmid@hotma il.com> wrote in message news:077f01c35a 96$4ab620b0$a60 1280a@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]

    Comment

    • bpschmid

      #3
      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:DataGri d id="DataGrid1" AutoGenerateCol umns="False"[/color]
      style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
      79px" runat="server">[color=blue]
      > <Columns>
      > <asp:TemplateCo lumn HeaderText="Ord er">
      > <ItemTemplate >
      > <asp:Hyperlin k runat="server" Text='<%[/color]
      #DataBinder.Eva l(Container.Dat aItem,"OrderID" )%>'
      NavigateUrl='<% # "page.aspx?Orde rid=" + DataBinder.Eval
      (Container.Data Item,"Orderid") + "&ProductID =" +
      DataBinder.Eval (Container.Data Item,"ProductID ")%>'
      ID="Hyperlink1 " NAME="Hyperlink 1"/>[color=blue]
      > </ItemTemplate>
      > </asp:TemplateCol umn>
      > </Columns>
      > </asp:DataGrid>
      >Use & in case of Vb.NET
      >HTH
      >Regards
      >Sushila
      >..NET MVP
      >
      >
      >
      >"bpschmid" <bpschmid@hotma il.com> wrote in message[/color]
      news:077f01c35a 96$4ab620b0$a60 1280a@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]

      Comment

      • Sonali.NET[MVP]

        #4
        Re: Passing multiple query string params from datagrid hyperlink column

        To pass 2 variable you wud use template column

        "bpschmid" <bpschmid@hotma il.com> wrote in message
        news:02c001c35a b3$bd039400$a30 1280a@phx.gbl.. .[color=blue]
        > Thanks!
        >
        > Do you have to use a template column?
        >
        >[color=green]
        > >-----Original Message-----
        > > Try
        > ><asp:DataGri d id="DataGrid1" AutoGenerateCol umns="False"[/color]
        > style="Z-INDEX: 101; LEFT: 66px; POSITION: absolute; TOP:
        > 79px" runat="server">[color=green]
        > > <Columns>
        > > <asp:TemplateCo lumn HeaderText="Ord er">
        > > <ItemTemplate >
        > > <asp:Hyperlin k runat="server" Text='<%[/color]
        > #DataBinder.Eva l(Container.Dat aItem,"OrderID" )%>'
        > NavigateUrl='<% # "page.aspx?Orde rid=" + DataBinder.Eval
        > (Container.Data Item,"Orderid") + "&ProductID =" +
        > DataBinder.Eval (Container.Data Item,"ProductID ")%>'
        > ID="Hyperlink1 " NAME="Hyperlink 1"/>[color=green]
        > > </ItemTemplate>
        > > </asp:TemplateCol umn>
        > > </Columns>
        > > </asp:DataGrid>
        > >Use & in case of Vb.NET
        > >HTH
        > >Regards
        > >Sushila
        > >..NET MVP
        > >
        > >
        > >
        > >"bpschmid" <bpschmid@hotma il.com> wrote in message[/color]
        > news:077f01c35a 96$4ab620b0$a60 1280a@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]


        Comment

        Working...