通过OnSuccess回调传递Url参数

时间:2012-11-15 17:37:59

标签: ajax.beginform

我需要使用URL中的2个参数并在OnSuccess回调函数中使用它们。

这是从服务器发送的网址:

http://localhost:35325/?Message=ChangePasswordSuccess&param1=%23UserSettings

我需要像这样发送param1:

@using (Ajax.BeginForm("Manage", "Account", new AjaxOptions { HttpMethod = "POST", Confirm = "Você tem certeza que deseja salvar a alteração?", OnSuccess = "close(Message, param1);" }))

这里我收到一条引用错误说: ReferenceError:未定义param1。

我该如何解决?

1 个答案:

答案 0 :(得分:0)

我发现这是正确的方法:

@using (Ajax.BeginForm("Manage", "Account", new AjaxOptions { HttpMethod = "POST", Confirm = "Você tem certeza que deseja salvar a alteração?", OnSuccess = "close(Message, param1);" }))

感谢