How to pass multiple hyperlink parameters with datagrid

G

Guest

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?
 
S

Shiva

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

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top