M
M
Mozzarella2018-01-07 21:06:00
ASP.NET
Mozzarella, 2018-01-07 21:06:00

Ajax request or method in controller (ASP.NET)?

ASP.NET Core project with connected Identity. There are two controllers Manage and Admin.
Index method in the Manage controller
5a525fedb7d9b956444745.png
There is an admin area where, when the edit button is clicked, the Manage controller's Index method is called with the Id parameter of the corresponding user. It is
5a52617235f56888636805.png
5a5261460b4a1806813242.png
required that the account editing form appear on the same page where the admin area is located. There are only two ways in my mind, to create a duplicate method in the Admin controller, or by ajax request to get the result of the execution of the Index method and embed it in the page. Is there any solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Borovik, 2018-01-07
@sfreaky

I think you answered your own question. By pressing the Edit button, two options follow: either send a request via ajax, and then paste the result somewhere, or simply make a normal request with a page refresh. The third is simply not given. In any case, you will have to create a new action method that generates a response to the request, and in which controller to create it is up to you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question