ASP.NET MVC 2: ViewData.Model.ExecuteResult does not exist

ViewData.Model.ExecuteResult does not exist in ASP.NET MVC2, but in MVC1.

What is the alternative in ASP.NET MVC2?

What I want to do is update the table after ajax request. Therefore, I put the table in an additional view. How to update this partial view without reloading the entire page?

+3
source share
1 answer

ExecuteResult is a method in the System.Web.Mvc.ActionResult class. Are you sure you don't want to look there?

http://aspnet.codeplex.com/SourceControl/changeset/view/23011#266522

The Model property is simply an object type and has always been AFAIK.

, , , , Ajax.BeginForm :

<% using (Ajax.BeginForm("Customers", new AjaxOptions { UpdateTargetId  = "customerList"})) { %>
    <!-- FORM HERE -->
<% } %>
<div id="customerList">
    <% Html.RenderPartial("CustomerList"); %>
</div>

'UpdateTargetId' - MVC "" ( , InsertionMode AjaxOption InsertBefore InsertAfter) Id .

Ajax, IsAjaxRequest, , :

if (Request.IsAjaxRequest())
    return PartialView("CustomerList");

// Not an Ajax request, return the full view
return View();

, !

+1

Source: https://habr.com/ru/post/1752507/


All Articles