How to pass multiple hyperlink parameters with datagrid

Discussion in 'ASP .Net' started by =?Utf-8?B?R3JlZyBSZXlub2xkcw==?=, Oct 20, 2004.

  1. Hi,

    I need to create datagrid hyperlink columns with multiple parameters in the
    URL.
    In my research on how to do this, it is recommended to create a template
    column which I have done. The code I am using is creating the following error

    BC30203: Identifier expected.

    Source Error:

    Line 36: <asp:TemplateColumn HeaderText="VIN">
    Line 37: <ItemTemplate>
    Line 38: <asp:HyperLink Runat="server"
    Line 39: NavigateUrl='<%# _
    Line 40: "Details.aspx?VINSeq=" &

    Here is the code I have added for the template column
    <asp:TemplateColumn HeaderText="VIN">
    <ItemTemplate>
    <asp:HyperLink Runat="server"
    NavigateUrl='<%# _
    "Details.aspx?VINSeq=" &
    Container.DataItem("VINSeq") & _
    "&VIN=" &
    Container.DataItem("VIN") %>' />
    </ItemTemplate>
    </asp:TemplateColumn>

    Any Ideas on a better way to pass multiple parameters with a data grid?

    --
    greynolds
     
    =?Utf-8?B?R3JlZyBSZXlub2xkcw==?=, Oct 20, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?R3JlZyBSZXlub2xkcw==?=

    Shiva Guest

    I believe for that you have to use a template column:

    <asp:TemplateColumn HeaderText="Order">
    <ItemTemplate>
    <asp:Hyperlink RunAt="server" NavigateUrl='<%# "Target.aspx?Id1=" +
    DataBinder.Eval (Container.DataItem,"Id1") & "&Id2="+
    DataBinder.Eval(Container.DataItem,"Id2")%>' ID="Category" Text='<%#
    DataBinder.Eval(Container.DataItem,"Title")%>' />
    </ItemTemplate>
    </asp:TemplateColumn>

    HTH

    "Greg Reynolds" <> wrote in message
    news:...
    Hi,

    I need to create datagrid hyperlink columns with multiple parameters in the
    URL.
    In my research on how to do this, it is recommended to create a template
    column which I have done. The code I am using is creating the following
    error

    BC30203: Identifier expected.

    Source Error:

    Line 36: <asp:TemplateColumn HeaderText="VIN">
    Line 37: <ItemTemplate>
    Line 38: <asp:HyperLink Runat="server"
    Line 39: NavigateUrl='<%# _
    Line 40: "Details.aspx?VINSeq=" &

    Here is the code I have added for the template column
    <asp:TemplateColumn HeaderText="VIN">
    <ItemTemplate>
    <asp:HyperLink Runat="server"
    NavigateUrl='<%# _
    "Details.aspx?VINSeq=" &
    Container.DataItem("VINSeq") & _
    "&VIN=" &
    Container.DataItem("VIN") %>' />
    </ItemTemplate>
    </asp:TemplateColumn>

    Any Ideas on a better way to pass multiple parameters with a data grid?

    --
    greynolds
     
    Shiva, Oct 20, 2004
    #2
    1. Advertising

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. LB
    Replies:
    1
    Views:
    1,179
    Patrick Olurotimi Ige
    Apr 1, 2005
  2. eRic

    Multiple Parameters With Hyperlink in DataGrid

    eRic, Jul 10, 2003, in forum: ASP .Net Building Controls
    Replies:
    5
    Views:
    190
    Eric Adler
    Jul 19, 2003
  3. Joriz

    pass 2 parameters using HyperLink column?

    Joriz, Jun 30, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    153
    DalePres
    Jul 2, 2004
  4. eRic

    Multiple Parameters With Hyperlink in DataGrid

    eRic, Jul 10, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    124
  5. LB

    multiple parameters for a datagrid url hyperlink

    LB, Mar 31, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    125
Loading...

Share This Page