I am usin the HyperLinkField in my asp.net application.
However when I use the DateNavigateUrlFormation I meet some problem:
This is the code :
<asp:hyperlinkfield datanavigateurlfields="tab_name,rowid"
DataNavigateUrlFormatString="~\details.aspx?tab={0}&rowid={1}" />
Since sometime the rowid may contain some characters which has the specified meaning in the http,so in the server side I can not get the correct rowid.
For example,the rowid of one row maybe
AAAAAAAXXX+BA
Now the generated url would be :
http://xxx/details.aspx?tab=tab_name&rowid=AAAAAAAXXX+BA
Since there is a character + here,I want to excape it.
I tried this:
DataNavigateUrlFormatString="~\details.aspx?tab={0}&rowid=<%#Server.HtmlEncode({1})%>"
It does not work also.
Any ideas?
You need to handle this in the
RowDataBoundevent.Update
Take a look at this article
According to that you can programatically access the hyperlink field.
OR I think what you need is to handle it in the RowDataBound event.