Note that there are some explanatory texts on larger screens.

plurals
  1. POPartial View not getting executed
    primarykey
    data
    text
    <p>I have a Partial View that returns a table which is inserted in the DOM using Ajax.BeginForm(). But the Partial View is not getting called. When I step through the debugger, it just steps over the Partial View. Why?</p> <p>--------------- This is the View with the Ajax call ----------------------</p> <pre><code>&lt;h2&gt;Enter a street name&lt;/h2&gt; @using (Ajax.BeginForm("QuickSearchResults", "Search", new AjaxOptions { HttpMethod = "Get", InsertionMode = InsertionMode.Replace, UpdateTargetId = "test" })) { &lt;input type="text" name="q" /&gt; &lt;input type="submit" value="Search" /&gt; } &lt;div id="test"&gt; &lt;/div&gt; </code></pre> <p>----------------------Controller Action ---------------------------------- </p> <pre><code> public PartialViewResult QuickSearchResults(string q) { ViewBag.LogOn = true; var properties = remsrepository.GetPropertyByStreetName(q); **return PartialView("_Property", properties);** } ------------------------------Partial View -------------------------- @model IEnumerable&lt;REMS.Models.Property&gt; &lt;table id="searchresults"&gt; &lt;tr&gt; &lt;th&gt;Adress&lt;/th&gt; &lt;th&gt;Status&lt;/th&gt; &lt;th&gt;List Price&lt;/th&gt; &lt;/tr&gt; @foreach(var item in Model) { &lt;tr&gt; &lt;td&gt; @Html.ActionLink(item.Property_Address.Street__ + " " + `item.Property_Address.Street_Name,` "PropertyDetails","Search", new {MLS = item.MLS}) &lt;/td&gt; &lt;td&gt; @item.Status &lt;/td&gt; &lt;td&gt; @item.List_Price &lt;/td&gt; &lt;/tr&gt; } &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload