Hi there! I am new to C # and I have a question about passing a string variable from C# to a function called PostFailure in JavaScript. The issue I'm facing is that the function seems to be returning some object and I am not sure where it is coming from. Here's a snippet of my code:
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 solution I am thinking of involves modifying the code like this:
Index.cshtml;
@using (Ajax.BeginForm("Login", "Account", new
AjaxOptions { HttpMethod = "post", OnBegin = "PostOnBegin", OnFailure
= "PostFailure(message,'hello')", OnSuccess
= "PostSuccess", OnComplete = "PostOnComplete" }))
anylib.js
function PostFailure(message,x){
}