locked
What is best practice Ajax or "asp-controller" to sent data to Controller RRS feed

  • Question

  • User1349399736 posted

    Hi everyone. I just begin learn .NET Core online.

    somebody they use Ajax sent data and somebody use "asp-controller=' ', asp-method=' ' " sent data

    i am verry confuse dont know best practice is Ajax or "asp-controller" 

    (sorry for my bad english)

    Wednesday, November 21, 2018 2:11 PM

Answers

  • User-821857111 posted

    It's not really a question of "best practice". It depends on what you want to achieve. You can either use AJAX to post data, in which case the page won't refresh, or you can submit a form and the whole page reloads, just like when you post a question here or reply.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 21, 2018 4:30 PM

All replies

  • User-821857111 posted

    It's not really a question of "best practice". It depends on what you want to achieve. You can either use AJAX to post data, in which case the page won't refresh, or you can submit a form and the whole page reloads, just like when you post a question here or reply.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 21, 2018 4:30 PM
  • User1349399736 posted

    Thank you very much. Now i can understand which case i can use ajax

    Thursday, November 22, 2018 3:00 AM