Most of the times we want to display an item from a database that may or may not have an associated download file link or image etc.
For example: you have different notices to be displayed on website, few of those notice records in database are having downloadble file (in db) and others may not have. and you want to display DOWNLOAD Link only where downloadble file exists in the database record.
If you bind the hyperlink to an
C#:
Visible='<%# Eval("filePath")==DBNull.Value ? false: true %>'
VB.Net
Visible=<%# IIf(Eval("filePath") Is DbNull.Value, "False","True") %>'
No comments:
Post a Comment