ModelState.AddModelError() did not show the error message second time

1 Answer 855 Views
General Discussions
ravi
Top achievements
Rank 1
ravi asked on 07 Sep 2022, 11:14 AM

In my application I have used 

ModelState.AddModelError("Fieldid", "ErrorMessage");

first time on button click it is validating fine, 

from second time(without refreshing the page) I give another wrong input and it still validate but error message on UI didn't show.

tried debugging the code didn't found any issue,

tried to see console on web browser , no error shows.

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 12 Sep 2022, 08:46 AM

Hi Ravi,

Thank you for reaching out.

I noticed that there is not a Telerik UI for ASP.NET Core license associated with your account which limits the availability of our support services for the product. In this regard, It is recommended that you either purchase or renew your license in order to gain access to the latest updates, fixes, features, and support regarding the Telerik UI for ASP.NET Core components. More information regarding the currently available plans can be reviewed here:

Nevertheless, based on the provided information it is hard to determine why the encountered issue could be potentially arising. In this regard, could you please consider sharing additional details about the currently utilized scenario where the ModelState is being utilized.

For example, a code snippet showing the implemented configuration thus far would be beneficial for the case, as it will help me get a better overall understanding of case. In addition, is the ModelState used within a form scenario? Are there any other components involved within your scenario that trigger the server-side validation?

Kind Regards,
Alexander
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions
Asked by
ravi
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or