2012-11-15 229 views
1

我需要使用2個參數進入URL並在OnSuccess回調函數中使用它們。通過OnSuccess回調傳遞Url參數

這是從服務器發送的網址:

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

我需要參數1到這樣的發送:

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

在這裏我得到一個參考錯誤,說: 的ReferenceError:參數1沒有定義。

我該如何解決?

回答

0

我發現,這是正確的方式去:

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

感謝