This is a migrated thread and some comments may be shown as answers.

ItemTemplate needs hyperlink

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 16 Sep 2011, 02:28 PM
Hi Guys,

I have a RadGrid and I need to place a hyperlink in the ItemTemplate. If I hard code the NavigateURL to "Supplier.aspx?ID=1079" everything works well. However, I want to replace the "1079" with the supplier id for this particular record and I just can not get the syntax correct. How do I get Eval("suplid") into the NavigateURL?

<asp:HyperLink ID="HyperLink11" runat="server" NavigateUrl='Supplier.aspx?Supplier=1079'><%# Eval("suplnm")%></asp:HyperLink>

William

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 16 Sep 2011, 02:34 PM
Hello,

Method1
NavigateUrl='<%# "Supplier.aspx?Supplier=" +  Eval("suplnm").ToString() %>'


Method2

NavigateUrl='<%# string.Format("Supplier.aspx?Supplier={0}" , Eval("suplnm").ToString()) %>'

Let me know if any concern.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
William
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or