I have a user control that contains a repeater. The repeater outputs either one or two columns based on the parameters used when an instance of it is created.
If a value is not specified for the second column i.e only one column should be displayed, it doesn't seem to like it if a value hasn't been set.
I'm trying to output a string that is set in the user control code behind, not a data item.
I have the following aspx:
<%# Eval(Column2Data) == DBNull.Value ? "</tr> " : String.Format("<td>{0}</td></tr>", Eval(Column2Data))%>
If Column2Data
has a value, it works but if it doesn't the following error is displayed:
Value cannot be null.
Parameter name: expression
Any ideas why this isn't working?