リクエストパラメータを取得できません...
私は自分のサービス ページに POST メソッドで ajax を使用してリクエストを行い、ブラウザ コンソールで次のように送信しました。
localhost/Services/?target=test&action=list&from=test
次のように送信:
$.ajax({
url: '@Url.Action(Url.Content("../Services"))',
type: 'POST',
data: "target="+$(this).attr('id')+"&action=list&from=test",
dataType: 'string',
success: OnSuccess
});
私のコントローラーで、私は試しました:
var context = System.Web.HttpContext.Current;
var q = context.Request.QueryString; //empty
var q2 = context.Request.Url.Query; //empty
// or
var id = Request.QueryString["target"].ToString(); //error - sample on the following link
どうしたの ?