MVC3を使用していますが、私の見解では次のコードブロックがあります。リダイレクトで「潜在的に危険な要求」が発生した場合、疑問符を含むURLを使用するのはなぜですか?
Response.Redirect(@Url.Action("index","home", new {error = "test"}));
ので、私が期待するURLがhttp://marketurk.co.uk/?error=testですが、私が得る、私は潜在的に危険な要求を取得するように、このhttp://marketurk.co.uk/%3Ferror=testです。
誰も同じ問題を抱えていて、何が間違っているのか教えていただけますか?
UPDATE:以下のようにIは、コントローラメソッドに私のロジックを移動 。
public ActionResult Index()
{
if (!User.Identity.IsAuthenticated)
return RedirectToAction("index", "home", new { error = "test" });
return View();
}
それはまだにリダイレクトhttp://marketurk.co.uk/%3Ferror=test
この行@ Url.Action( "index"、 "home"、new {error = "test"})はリダイレクトの外で何を生成しますか? – gdoron
これは/?エラー=テスト – Cem