2022-09-18

ASP.NET Core, how to return data like string from controller to client view without refreshing page?

Client will call controller action method like through button click, controller will do its stuff and will return data like a simple string message, then client will get this data and do some stuff like showing a toast msg with JS. The problem is client page shouldn't be refreshed. I know Ajax is a solution for this but just wondering if any workaround is possible? Controller method can return Nocontent() and this doesn't refresh the page but looks like no way to return data with that. Thanks



No comments:

Post a Comment