469,612 Members | 2,224 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

How to pass multiple hyperlink parameters with datagrid

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
Nov 18 '05 #1
1 3743
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" <Gr**********@discussions.microsoft.com> wrote in message
news:55**********************************@microsof t.com...
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
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by cksj | last post: by
1 post views Thread by Amy | last post: by
3 posts views Thread by Kumar | last post: by
2 posts views Thread by Carl Howarth | last post: by
1 post views Thread by carlor | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.