What I want to achieve is when the user entered the wrong data, the image label will be displayed.
The visible method is not recommended due to my lblMessage service for other purposes.
My big big problem now that users have corrected their input field, the label message is disabled, but the image is still visible, simply because I set lblMessage to null .
Is there any method that I can use, for example, when there is something to have lblMessage call the CSS image, but whenever there is nothing in lblMessage, css does not start?
if (!Utils.mtdIsBlank(Session["Message"])) { lblMessage.Text = Session["Message"].ToString(); Session["Message"] = null; } else { lblMessage.Text = ""; }
source share