ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Return type of inline delete on errors
Title:
B
I
{code}
?
Hi, i use the inline delete of a grid with the confirm input return PartialView(new GridDeleteConfirmInput { Id = id, Message = string.Format("Are you sure you want to delete faq category <b>{0}</b>?", model.Name) }); On success i return return Json(new { input.Id }); which is working on errors i would like to return an error message and tried return Json(GetErrorsInline(ModelState)); but the message is not shown by the confirm popup. How can i get the errors to the popup? Best regards M
Save Changes
Cancel
Martin Strojek
asked at 10 Mar 2017
what's the point of `GridDeleteConfirmInput`, is it any different from `DeleteConfirmInput` from the demo ? you're probably calling `Html.InitDeletePopupForGrid` if you look inside you'll see that InitPopupForm is called and the Success js function is `utils.itemDeleted`, this function gets the json you return from the server; in the latest demo you can just throw an exception and it will popup in the right top corner if you want to show the message in the confirm popup, just return a string/partial view instead of json
at 10 Mar 2017
Omu
Great, thanks a lot - did not know that it was so easy. After returning the message string only it works!
at 10 Mar 2017
Martin Strojek
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK