views:

127

answers:

2

I am using NavigateURL to dynamically pull in the url of products on a receipt page.

Here is the exact code:

<a class="blue13" href="<%#Eval("Product.NavigateUrl")%>"><%#Eval("Product.Name")%></a>

It is placing "/checkout/~/" in each of the url.

How can I remove or correct this?

Thanks!

A: 

The simplest thing would probably be to just call .Replace() and replace the unwanted part with a empty string. But it depends relay. Why is it there to begin with? Where is the data coming from?

Mattias Jakobsson
Thanks Mattias. I actually just figured out a solution.
Joe
A: 

I ended up switching from a regular href to an asp:HyperLink and it corrected the /~/ issue.

So, before I was using

<a class="blue13" href="<%#Eval("Product.NavigateUrl")%>" runat="server"><%#Eval("Product.Name")%></a><br/>

And I switched it to:

<asp:HyperLink CssClass="blue13" runat="server" NavigateUrl='<%#Eval("Product.NavigateUrl")%>' Text='<%#Eval("Product.Name")%>'></asp:HyperLink>

Which correct the issue.

Thanks.

Joe