는 "나는 드롭 다운 목록과 DDL의 변화에이 컨트롤러는 다시 같은 내용을로드 부분보기를 반환하는 호출 인덱스보기를 bindind 한 사용하여 쿼리 문자열 VIEW : 내가보기를 편집하고이 페이지에서 내가 돌아 가기 쿼리 STR과 인덱스 컨트롤러로 리디렉션되는 액션 링크를 가지고 리디렉션되는 편집 작업 링크가 이상에서Ajax 요청은
@model IEnumerable<StoreManagement.Models.ProductEntity>
<div id="Products">
@if (Model != null)
{
<table style="width:100%;">
<tr>
<th>Product Name </th>
<th>Max Qty</th>
<th>Min Qty</th>
<th>Edit</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>@item.ProductName.ToString()</td>
<td>@item.MaxQty</td>
<td>@item.MinQty</td>
<td>@Html.ActionLink("Edit","EditProduct",new {[email protected]},null)</td>
</tr>
}
</table>
}
</div>
DropIdlist를 선택할 때 사용하고있는 CategoryId로 보내십시오.
이제 CategoryId를 쿼리 문자열로 사용하여 인덱스보기를로드하려고합니다.
if (Request.IsAjaxRequest())
{
var model = ObjStore.products.Where(x => x.CategoryId == Prod.CategoryId);
return PartialView("_ProductMaster", model);
}
else if (CategoryId != "" && CategoryId !=null)
{
var model = ObjStore.products.Where(x => x.CategoryId == Prod.CategoryId);
return PartialView("_ProductMaster", model);
}
'그렇지 않은 코드는 다음을 위해 노력하고 있습니다'그러나 그것은 단지 부분 뷰를 돌려줍니다. _layout 페이지로 뷰로드를 원합니다. 또는 URl에 쿼리 문자열이있는 경우 DDL의 onchange 이벤트를 호출 할 수있는 방법이 있습니까? 아니면 Request.IsAjaxRequest()를 true로 설정하십시오. "
이 체크 아웃으로,이 사람이 비슷한 문제가 있었다 것 같습니다. http://stackoverflow.com/questions/21608567/mvc-4-refreshing-partial-view/21608718# 21608718 – CSharper
해결책을 찾지 못했습니다 .... – Danydude