Click here to Skip to main content
15,918,049 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
i know how to use Eval function with one parameters
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "ShowPages/{0}") %>'></asp:HyperLink>

but now i want use Eval Function with two parameters.
something like this

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID","Title", "ShowPages/{0}/{1}") %>'></asp:HyperLink>

how can i do that?
Updated 2-May-13 9:32am
aref.bozorgmehr 2-May-13 16:22pm    
I need answer please

Your first exaple maps to DataBinder.Eval[^], and there isn't an overload that takes more arguments.

You could try:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "ShowPages/{0}/")+Eval("Title", "{0}") %>'></asp:HyperLink>

I guess the above should work, since this
<asp:Label ID="Label1" runat="server"  Text='<%# Request.Browser.Platform + "-" + Request.Browser.Browser %>' />

works pretty well, but I haven't tried it.

Best regards
Espen Harlinn
Share this answer
or this
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# String.Format("~/Show/Display_PostID.aspx?TopicID={0}&Subject={1}"  ,Eval("TopicID"),  Eval("Subject")) %>'
 <%# Fakhravary.Text.SubString(Eval("Subject").ToString  (), 0, 48)%>
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900