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
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