That particular line of code will not generate the error you're talking about. It is a simple string comparison. I'm making an assumption here that caseNumber
is a web control, maybe a Textbox? Can you confirm?
If it is a Textbox then that should just be retrieving the value as a string (everything is convertible to that) and then comparing it against an empty string. But what we cannot tell is if that control is actually something else (perhaps a third party library) or using something like the AJAX mask property or something. In those cases it is possible the property is trying to convert the actual value to a formatted value but that would seem odd since Text
shouldn't be touched directly and is how the value would get back to the server anyway.
Can you please provide more context around that particular field in your code? Additionally please post the exception details including the inner exception (if any) and the stack trace.