vb.net - How to display a Labels 'Error on ErrorProvider1' -


target

I want to display the label I labeled as "ErrorTranslator 1 error" Attribute in the feature whenever I get an error see the properties of the label below.

Error on ErrorProvider1

I have my error provider1 Trying to display the text in the red rectangle in the SetError (Control, Value) function. If the TextBox1.Text.Trim.Contains ("'") then the error reporter 1.SetError (lblErr, ErrorProvider1.GetError (lblErr)), other error reporter 1.SetError (lblErr, "") end If

how can I get an error on ErrorTrader 1 LblErr to display it in ErrorProvider1 SetError value

Your problem is that you are replacing the error message when nothing is wrong as mentioned in your comment below, In the tag The local error message is accumulating, so that you can do the following:

  If TextBox1.Text.Trim is included in it ("'' ') then ErrorTransfer 1.SetError (lblErr, lblErr.Tag) ) Other ErrorTrader 1.SetError (lblErr, "") If you were right to use   errorProvider1 GetError (Control)  It is fine that you want to replace it with empty string before retrieving it.   

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -