目前,頁面重定向不起作用。該頁面的URL在http://localhost:40823/Account/SignIn。該頁面根本就沒有重定向。我不知道為什么這種方法不能重定向。有什么想法嗎?我設定了一個斷點,并瀏覽了我的代碼,它到達了回傳陳述句,但它沒有作業。我在其他地方也用過這個方法,效果非常好。我只是把回傳陳述句復制到這里,但它并沒有作業。
[HttpPost]
public ActionResult PasswordRequest(string email) /span>
{
Player player= GetPlayer();
try
{
player.Email = Login.EmailAddress = email;
ResetPassword(player);
}
catch(Exception ex) {
console.log("Error")
}
return RedirectToAction("SignIn", "Account") 。
}
uj5u.com熱心網友回復:
你正在使用ajax來呼叫PasswordRequest動作,ajax忽略了所有的重定向,總是回傳到success:或錯誤的javascript函式。如果你想在控制器中使用重定向,你將不得不使用提交按鈕或ancor標簽來呼叫PasswordRequest。另一種方法是在success ajax函式中指定window.location.href =http://localhost:40823/Account/SignIn。
。轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/306653.html
標籤:
上一篇:如何從另一個檔案匯入多個變數
下一篇:為什么日志級別沒有變化?
