G
Guest
I have a label control on my form I'm using the same way a label is used with
a validator control; the reason for this is lost somewhere in antiquity at my
employer. Anyway, I do a substantial amount of client-side data validation
via JavaScript, setting the Text property of the label to something pertinent
to the error encountered. Since the label is never invisible or hidden, the
message is shown as soon as the display refreshes. So far, so good.
Let's now say that everything passes the client-side validation and
execution is passed to the form's code-behind, but an error occurs when I try
persisting the data out to the database. Again, I set the Text property of
the label to something pertaining to the error that occurred. In this
situation, the message is never displayed even though the Label control is
still visible and still contains text. Why is that?
Changing lblError's text property via JavaScript:
document.getElementById('ctl00_ContentPlaceHolder1_lblError').innerText
= 'Please enter at least one search criteria.';
Changing lblError's text property via VB.Net code-behind:
lblError.Text = "Unable to save highlighted record(s) to database."
a validator control; the reason for this is lost somewhere in antiquity at my
employer. Anyway, I do a substantial amount of client-side data validation
via JavaScript, setting the Text property of the label to something pertinent
to the error encountered. Since the label is never invisible or hidden, the
message is shown as soon as the display refreshes. So far, so good.
Let's now say that everything passes the client-side validation and
execution is passed to the form's code-behind, but an error occurs when I try
persisting the data out to the database. Again, I set the Text property of
the label to something pertaining to the error that occurred. In this
situation, the message is never displayed even though the Label control is
still visible and still contains text. Why is that?
Changing lblError's text property via JavaScript:
document.getElementById('ctl00_ContentPlaceHolder1_lblError').innerText
= 'Please enter at least one search criteria.';
Changing lblError's text property via VB.Net code-behind:
lblError.Text = "Unable to save highlighted record(s) to database."