I thought this will help u guys to get an idea about appending two strings. Solution as follows.
<asp:HyperLink ID="customerHyperLink" runat="server"
Text= '<%# DataBinder.Eval(Container.DataItem, "Name") %>' NavigateUrl='<%# "~/Pages/YourPage.aspx?id=" + DataBinder.Eval(Container.DataItem, "id") %>'></asp:HyperLink>
You can see how I have appended these two value in NavigateUrl property.
Hope some one will get the advantage of this post.
2 comments:
I kept getting "Input string was not in a correct format" when I used your exact code. So I changed the '+' in the navigateurl to a '&' and it works. I have used '+' before to concatenate but for some reason it would not take it here... I guess it's just another option. Thanks for the tip!
Thanks for the aditional info Anthony.
Post a Comment