사용자가 드롭 다운 목록을 변경할 때 내 양식에 드롭 다운 목록이 있습니다.보기에서 2 개의 값을 URL에서 컨트롤러 작업 방법으로 보내고 싶습니다. 아래 방법으로 1 개의 값을 보낼 수 있지만 어떻게 할당 할 수 있습니까? 스크립트에 또 다른 값 .. continentId도 할당하고 싶습니다.
<script type="text/javascript">
$(function () { $('#CountryId').change(function () { window.parent.location.href = "CountryCategory?countryId=" + $('#CountryId').val(); }); });
</script>
public actionresult CountryCategory(string countryId,string continentId)
{
}
내 작업 방법에는 두 개의 매개 변수가 필요합니다.
이 시도
var countryId = $('#CountryId').val();
var continentId= $('#ContinentId').val();
window.location.replace("CountryCategory?CountryId=" + countryId + "&ContinentId=" + continentId+ "");
왜 $ .post ()가 아닌가?
$.post("CountryCategory",{CountryId : countryId,ContinentId : continentId},function(result){
//receive data
alert(result);
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다