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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top