In my asp.net-mvc website I have a field that usually has a string (from database) but can from time to time contain nothing.
Because IE doesn't know how to handle the css "empty-cells" tag, empty table cells need to be filled with an
I thought
Html.Encode(" ");
would fix this for me, but apparantly, it just returns " ". I could implement this logic as follows
Html.Encode(theString).Equals(" ")?" ":Html.Encode(theString);
Also a non-shorthand-if would be possible but frankly, both options are but ugly. Isn't there a more readable, compact way of putting that optional space there?