Hi,
In a transformation, I am trying to check if a custom page field is empty. Currently, I've tried the following:
<% if(Eval("Custom_Page_Field") != ""){ %> <% } %>
and
<% if(Eval("Custom_Page_Field") != null){ %> <% } %>
And both are not working for me.
Try casting the object like so:
Eval<string>("FieldName") == ""
Or
IfEmpty(Eval<string>("FieldName"), true, false)
ValidationHelper.GetString(Eval("FieldName"), "") == ""
Eval("FieldName").ToString() == ""
@Brenden Thank you. I did not know that Eval() did not return a String... It works now, thank you for your help!
Eval("FieldName") by default returns an object. In most cases, we get lucky and the control rendering the data can type it out. In some cases you have to tell it what type you're working with.
Eval("FieldName")
Please, sign in to be able to submit a new answer.