ajax.beginform insertionmode,asp.net mvc – MVC Ajax.BeginForm InsertionMode – Stack Overflow

  • Post author:
  • Post category:其他


Web Config:

JavaScript referenced files:

CSHTML page:

@using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = “result”, LoadingElementId = “progress”, InsertionMode = InsertionMode.Replace }))

{

@Url.Content(

}

Controller.cs:

[HttpPost]

public string Index(SignUpModel model)

{

return “Hello”;

}

What’s the reason when i click on the SUBMIT button, the entire page gets replace with a white page that says “hello”. I was under the impression that Ajax.BeginForm would replace the content of the DIV RESULT.

What am I doing wrong??

Also, the LoadingElementID

Would it HIDE automatically when the AJAX call will return its value?

=========================

ANSWER

Firebug showed that one of the Referenced JS files was NOT FOUND.

After I fixed that ..it all worked as expected.

Thanks guys