I am starting to learn ASP.Net MVC (candidate for release) and I have small problems. I might just be picky, but I thought I'd ask.
I want to use the built-in (advanced) ASP.NET Ajax methods to call my controller called "GetNames", which returns a JsonResult object. I saw examples that use the $ .getJSON () jQuery method, but I would rather do something like this:
<%using ( Ajax.BeginForm("GetNames", new AjaxOptions() { OnSuccess = "GetNamesSuccess", OnBegin = "GetNamesBegin", OnComplete = "GetNamesComplte", OnFailure = "GetNamesFailure" } ) ) { %>
<%=Html.TextBox("DummyData") %>
<input type=submit />
<% } %>
<script type="text/javascript">
function GetNamesSuccess()
{
alert("Success");
}
function GetNamesBegin()
{
alert("Begin");
}
function GetNamesComplete()
{
alert("Complete");
}
function GetNamesFailure()
{
alert("Failure");
}
</script>
"", , , Json, , , , . ... , Ajax.BeginForm , Json OnSuccess, OnComplete.
?