Hi, I am new in c#
and I need to pass in the following función(PostFailure)
in js
a variable string of c#
. The problem is that the message
parameter has a json
that I can not understand where it comes from. My current 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){
}
but I miss compilation error.