I have a webforms application. In this application I have this line in my ASP.NET.
<strong><a href="/UpLoads/<%# Eval("DsPathDocumento")%>" class="linkUpload"><%# Eval("NmTipoDocumento")%></a></strong>
Well, what I want is for this link to only mount when there is a document. I have done so and it is giving error that it is only possible within a Databound.
if(!String.IsNullOrEmpty(Eval("DsPathDocumento ").ToString())) { %>
<<strong><a href="/UpLoads/<%# Eval("DsPathDocumento")%>" class="linkUpload"><%# Eval("NmTipoDocumento")%></a></strong>
<% } %
>
How do I resolve this? This is the error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.