basically i got no idea to starts so i cant provide any better code
i have a null label
lblErrorMsg = "" ;
once if there are any error, my label will display error msg with css
lblErrorMsg.Text = "some error Msg";
at the same time i am trying to display another image label as well, but i dont want to make it like button click then display the error msg, due to this is an on-going project, so there are lot of button, so what i want to ask is, is there any method can perform during page load to detect label text change?
something like
pageload(){
check lblErrorMsg
if(lblErrorMsg.Text!=""){
lblImg.Visible= true;
}else{
lblImg.Visible= false;
}
}
You need to use javascript/Jquery for that. Listen to onload event and do the logic.
You can try putting this in the script tag of your aspx page