0
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 that this link only mounts when there is document. I went through and is giving error that it is only possible inside a Databound.
if(!String.IsNullOrEmpty(Eval("DsPathDocumento ").ToString())) { %>
<<strong><a href="/UpLoads/<%# Eval("DsPathDocumento")%>" class="linkUpload"><%# Eval("NmTipoDocumento")%></a></strong>
<% } %
>
How do I fix this? That is the mistake:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
What is the property on your Dataset that says the registry has or has no documents? The folder is Dspathdocument, but there must be a "Temdocumento" property in your Dataset, so you can tell if the link should appear or not.
– Andrew Paes
The Dspathdocumento field itself is the field I want to test. If it brings something is that there is document, if it comes null or empty has no document. It is by this field that I want to create the link.
– pnet