드롭 다운 선택 드롭 다운 값을 선택하면 컨트롤러 동작 방법이 표시되지 않습니다. 선택된 값이 아약스에 바인딩하지만 컨트롤러 액션 메소드에 바인딩되지 see our page컨트롤러 데이터 전달보기
<div class="row">
<div class="col-lg-3">
<fieldset class="form-group">
<label class="form-label semibold control-label">Generic</label>
@Html.DropDownList("MasterGenericID", null, "--- Select Generic ---", new { @class = "select2-arrow" })
</fieldset>
</div>
$('#btnsearch').click(function() {
var genericID = $('#MasterGenericID').val();
$.ajax({
type: 'POST',
url: "@Url.Action("ProductMasterController", "ProductMasterview")",
data: JSON.stringify(GenericID),
contentType: "application/json",
dataType: 'json',
success: function(data) {
// if (response.id > 0)
alert("test" + data.GenericID);
},
async: true // make it true if you want to make an async call.
});
});
public ActionResult ProductMasterview(string GenericID)
if (Convert.ToInt32(GenericID) > 0)
{
return View(dPMSP.GetAllProductsUsingGenericID(GenericID));
}
else
{
Generic_Bind();
Therapeutic_Bind();
SubTherapeutic_Bind();
Formulation_Bind();
return View(dPMSP.GetAllProducts());
}
}
감사
작업 정의에'{' –