TemplateColumn, HyperLink and &Amp

V

Versteijn

Hello all,

I have a TemplateColumn, and a GetLink method, like below. In my
links, however, the & for the parameters gets converted to &. That
is definitely not what I want. What can I do about this?

My actual link contains more fields from the database, so using
HyperlinkColumn is not an option I guess.

Thank you.

Regards,

David van Leerdam



<asp:TemplateColumn SortExpression="Price" HeaderText="Price">
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.Price", "{0:C}") %>' NavigateUrl='<%#
getLink(CInt(DataBinder.Eval(Container, "DataItem.ProductID"))) %>'
Target="_self"></asp:HyperLink>
</ItemTemplate>

GetLink looks like this:

Public Function getLink(ByVal productid As Integer) As String
Dim Url As String

If Request("mode") = 2 Then
Url = String.Format("productdetail.aspx?product={0}",
productid)
Else
Url = String.Format("productdetail.aspx?test={0}",
productid)
End If

Return Url
End Function
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top