ASP.NET Forums/General ASP.NET/Getting Started/Is it possible to hide a template field if another field is null?
Is it possible to hide a template field if another field is null?
I'm working with a field in a Details View. In it, if field "DocumentType" is NULL from the database, then I don't need to display the hyperlink because there isn't a document. Is there a way to evaluate or look at the "DocumentType" field, and if it's null, then hide the TemplateField? -->I'm looking for a way to do this all in the .aspx,instead of the code behind as I don't want to rewrite the whole webpage.
Re: Is it possible to hide a template field if another field is null?
You can use eval to check if DocumentType is null or not and then make the Visibile property of hyperlink to True or False based on that.
You can try with the below code.
Thank you both for the suggestions. I had to modify for use with vb.net, but got it to work.