ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
AjaxList delete, return RedirectToAction
Title:
B
I
{code}
?
I'm working on a feature for my app where the user deletes his user account. The delete button is in a AjaxList; on the server side I'd like to use a RedirectToAction("Login", "Account") as the ActionResult for the Delete() method, but on the client the result expected is Json to update the list. How do you think I should accomplish the redirect?
Save Changes
Cancel
Stephan Luis
asked at 01 Nov 2018
well if you want to use `RedirectToAction`, the Delete button has to be non ajax, if it does an ajax request the `RedirectToAction` will redirect to the action which returns a view, so you'll get a string with the view html as a result; how is all this related to reloading the ajaxlist you have, I'm not sure, to reload it you can call the `$('#id').data('api').load();` when you want to reload it.
at 01 Nov 2018
Omu
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