1304654 Uab

1304654 Uab

  • NA
  • 8
  • 3.7k

How to pass reference variables in Ajax.BeginFrom

Feb 2 2016 9:52 AM
Hello I am new to C # and I need to spend in the following function ( PostFilure ) in js a string variable from C # . The problem is that the function returns some object and I don't understand where comes from. Currently my code is;
Index.cshtml;
@using (Ajax.BeginForm("Login", "Account", new AjaxOptions { HttpMethod = "post", OnBegin = "PostOnBegin", OnFailure = "PostFailure", OnSuccess = "PostSuccess", OnComplete = "PostOnComplete" }))
{...


anylib.js
function PostFailure (message){

}


the idea would be:
Index.cshtml;
@using (Ajax.BeginForm("Login", "Account", new AjaxOptions { HttpMethod = "post", OnBegin = "PostOnBegin", OnFailure = "PostFailure(messaje,'hola')", OnSuccess = "PostSuccess", OnComplete = "PostOnComplete" }))


anylib.js
function PostFailure (message,x){

}

Answers (2)