0
)を経由してすべての値を送信しないjQueryの経由で新しいブラウザウィンドウを開きます。はwindows.open(との問題を持つパラメータ
- フレームワーク:Asp.netMVC
- コード:C位、カミソリ
- 問題:機能トリガは、それがコントローラにパラメータを送信する必要があるとき
jqueryの firstname
、lastname
、dob
、及びgender
が、私はそれだけでfirstname
を送信し、他のパラメータがNULLの問題を抱えています。私はクライアント側でそれをデバッグするときには、すべてのパラメータが値を持っているが、それはそれだけで一つのパラメータを送信するアクションの結果を呼び出したときに表示されます。
$(document).ready(function() {
$(".ViewGet").click(function() {
var firstname = $(this).closest("tr").find(".firstname").text();
var lastname = $(this).closest("tr").find(".lastname").text();
var dob = $(this).closest("tr").find(".dob").text();
var gender = $(this).closest("tr").find(".gender").text();
window.open('@Url.Action("FindClientsFor","ClientSerach")?lastname=' + firstname, "&" + +"firstname=" + lastname + "&dob=" + dob + "&gender=" + 1 + 'popUpWindow', 'height=750, width=960, left=300, top=100, resizable=yes, scrollbars=yes, toolbar=yes, menubar=no, location=no, directories=no, status=yes');
});
});
コントローラ
[HttpGet]
public ActionResult FindClients(string firstname, string lastname, string dob, int? gender,FormCollection collection)
{
if (IsNullOrEmpty(firstname) || IsNullOrEmpty(lastname) || IsNullOrEmpty(dob) || gender == null)
{
return RedirectToAction("Index");
}
else
{
var obj = _repo.ClientSearchWithAll(firstname, lastname, dob, gender);
//_repo.SortUserNames(obj);
return View(obj);
}
}