tags:

views:

219

answers:

1

In my application , users can post messages, a title and body. The message is then accessed by a user clicking the hyperlink of the title to read the message. However, if a colon is entered by the user the hyperlink is not clickable. I'm looking for the quickest, easiest way of resolving this

The hyperlink is in a GridView so the issue might be related to a colon in the hyperlink, when in a gridview is not clickable

+3  A: 

I think you need to do URL encoding using HttpServerUtility.UrlPathEncode

Edit: I'm not sure if I understood correctly whether the colons are in the URL or in the hyperlink text that is clicked?

Aziz
I assume from the OP that the problem is colons being rightly interpreted as a port, but yeah it's not super clear. Whatever the problem though encoding is the solution.
annakata
Thanks for the direction, the code worked as:hlf.DataTextField.Replace(":", Server.UrlEncode(":"));
Stuart