I'm in the process of learning Asp.Net MVC after coming off my WPF background. I basically want to click a button and update my model WITHOUT refreshing the page. I'm assuming I can do the following with AJAX somehow.
<input class="WelcomeButton" type="button" onclick="location.href='@Url.Action("SetGameType", "Welcome", new { gameType = GameTypes.Expert })'"/>
Any help would be great.
This is my progress after looking at Gent's Link
<input class="WelcomeButton" id="NoviceButton" type="button" style="left: 157px; top: 442px;"/>
$("#NoviceButton").click(function(){
$.ajax({
url: "@Url.Action("TestMethod", "Welcome")",
type: "post"
});
});
I have a button that submit and not have the button in a form...Either way the above didn't work with that url or this one url: "\Welcome\TestMethod",