Last post Jul 08, 2019 09:50 AM by PatriceSc
Jul 06, 2019 11:50 PM|pizzamaker74|LINK
I'd like to create a form where the form initially posts the images via Ajax and then after uploaded, the controller returns some data back to the page in the Ajax response.
Whats the best way to do this ?
Is this the best way or is there some way which is neater ?
Jul 07, 2019 02:08 AM|ignatandrei|LINK
the controller returns some data back to the page in the Ajax response.
This is standard Ajax in MVC. Make a controller ( in .NET 4.x , APIController to be fancy) and return ok( with data)
Jul 08, 2019 09:50 AM|PatriceSc|LINK
As pointed there you can use https://docs.microsoft.com/en-us/dotnet/api/system.web.mvc.controller.json?view=aspnet-mvc-5.2 to just return the value
you want rather than a view.
For now it seems you are confusing returning a "raw" value or HTML markup. Or the problem is that you are trying to use a single action while you want to return two distinct things ? Then the simplest approach could be to create another action.