Monday, March 3, 2025

Get Validation Error Message, Page.Isvaild False Section

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

 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