1
我有這樣一個方法,以便:有麻煩IUrlHelper
[HttpPost]
public async Task<IActionResult> Index(string token)
當我使用下面的行:
string url = Url.Action("Index", "Confirm", "mViH%2BZBz4l2%2Bx97rackKlFTWLVeD4xl9c%2B6ggbjbXzpAT%2BLP%2BKWvLqGymZSgV7GEPoXPSRHx6vO1ytaKPbfYrON%2BqP21EGMop3hW1%2BwoHL0Xf7bDSS5EHiqyuwNmiiJiMAYZPgr%2FCe%2FXyZFLCy%2FbfuGCOK3iawGOhdD0DyignbUC3xNybkfZkJNaXNHJlHnIv5eu8Z4wjzFkMmb1SOi5YmIzfT%2FjFovhy6fVFbDQXsc0GBzKqNsZjCudTKSPbMoRV6%2FAjw%3D%3D");
網址結束是:
"/Confirm?Length=292"
代替:
"/Confirm?token=mViH%2BZBz4l2%2Bx97rackKlFTWLVeD4xl9c%2B6ggbjbXzpAT%2BLP%2BKWvLqGymZSgV7GEPoXPSRHx6vO1ytaKPbfYrON%2BqP21EGMop3hW1%2BwoHL0Xf7bDSS5EHiqyuwNmiiJiMAYZPgr%2FCe%2FXyZFLCy%2FbfuGCOK3iawGOhdD0DyignbUC3xNybkfZkJNaXNHJlHnIv5eu8Z4wjzFkMmb1SOi5YmIzfT%2FjFovhy6fVFbDQXsc0GBzKqNsZjCudTKSPbMoRV6%2FAjw%3D%3D"
有誰知道這是爲什麼?我已經嘗試過的任何事情都無法解決這個問題。如果我手動創建鏈接並使用它,它將起作用。
因爲需要提供一個表達式'Url.Action( 「索引」, 「確認」,新的{令牌= 「....」})' – Nkosi