0

I have one question about about ASP.NET

In Razor, what is the command used to create a button to send an event back to the controller without refreshing the page when clicked?

Draken
  • 3,134
  • 13
  • 34
  • 54
Jerry
  • 15
  • 7
  • 2
    Possible duplicate of [How to use Simple Ajax Beginform in Asp.net MVC 4?](http://stackoverflow.com/questions/17095443/how-to-use-simple-ajax-beginform-in-asp-net-mvc-4) – MichaelMao Jul 18 '16 at 02:43
  • You can use Ajax.BeginForm for a submit button, or via ajax via JS. – denchu Jul 18 '16 at 03:13

1 Answers1

0

you should use java script ajax call to server , there is no code behind event as there was in asp.net form . or if you want pure single page app , better use web api instead of mvc . in web api you can post json and get json as result , and then use client side framework (angular, ember ) to loop or show data on page.

Arash
  • 3,458
  • 7
  • 32
  • 50