如何從 ASP.Net MVC modelState 獲取所有錯誤? - How to get all Errors from ASP.Net MVC modelState?

問題:

I want to get all the error messages out of the modelState without knowing the key values.我想在不知道鍵值的情況下從 modelState 中獲取所有錯誤消息。 Looping through to grab all the error messages that the ModelState contains.循環獲取 ModelState 包含的所有錯誤消息。

How can I do this?我怎樣才能做到這一點?


解決方案:

參考一: https://en.stackoom.com/question/5fxk
參考二: https://stackoom.com/question/5fxk
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章