character encoding - URL having a & getting encoded in a ASP.NET repeater control -
i have url in asp.net repeater control:
http://www.someurl.com/test.aspx?abc=t&bd=1
this gets encoded &
when gets rendered browser.
we have tried decoding using server side tags in repeater, did not work.
how can stop happening?
example:
on server: http://www.someurl.com/registration?pcid=free15&pid=a1v80000000pq6zeag
on client: http://www.someurl.com?pcid=free15&pid=a1v80000000pq6zeag
@aspnetdev, row below shows url looks in database, 1 or 2?
--------------------------------------------------- | id | url | --------------------------------------------------- | 1 | http://www.example.com/?id=1&name=test | | 2 | http://www.example.com/?id=1&name=test | ---------------------------------------------------
is rough approximation of repeater looks like?
<asp:repeater runat="server" id="repmain"> <headertemplate> <ul> </headertemplate> <footertemplate> </ul> </footertemplate> <itemtemplate> <li><a href="<%#databinder.eval(container.dataitem, "url")%>"><%#databinder.eval(container.dataitem, "url")%></a></li> </itemtemplate> </asp:repeater>
if row #2 highly recommend decode urls in database in row #1. you're going running issues if use #2 method.
using above repeater, row #1 like:
<li><a href="http://www.example.com/?id=1&name=test">http://www.example.com/?id=1&name=test</a></li>
this invalid html because literal ampersands must escaped using &
here's how row #2 appear:
<li><a href="http://www.example.com/?id=1&name=test">http://www.example.com/?id=1&name=test</a></li>
this valid html , should not corrected.
can elaborate on samples or post of own?
Comments
Post a Comment