Monday, March 3, 2025

Get Validation Error Message, Page.Isvaild False Section, BaseValidator, get server side error message

if you wanted to know the route cause of error message then we can write below code in aso.net 

Get Validation Error Message, Page.Isvaild False Section, BaseValidator,  get server side error message

 foreach (BaseValidator validator in Page.Validators)

            {

                if (validator.Enabled && !validator.IsValid)

                {

                    // Put a breakpoint here

                    string clientID = validator.ClientID;

                    string aa = validator.ErrorMessage;

                }

            }

No comments:

Post a Comment