Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC4 : refreshing partial view on button click
    primarykey
    data
    text
    <p>I'd like to do something simple. I've got a list of products (with a name attribute) with a "details" button next to each. When I click on the button, I want the details of the product to be displayed next to the list (unexpected, I know ^^).</p> <p>What I've done so far:</p> <p>Displayed the list of products - a name and button displayed for each product:</p> <pre><code>@foreach (var product in item.Value) { &lt;div&gt;id : @product.product.PRODUCT_ID , name : @product.product.PRODUCT_NAME @Html.ActionLink("Details", "ProductDetails", new { id = product.product.PRODUCT_ID }, null)&lt;/div&gt; } </code></pre> <p>The displaying of the details of a product in another page:</p> <pre><code>@model IEnumerable&lt;MyService.PRODUCT&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt; @Html.DisplayNameFor(model =&gt; model.EPC_NUMBER) &lt;/th&gt; &lt;th&gt; @Html.DisplayNameFor(model =&gt; model.PRODUCT_NAME) &lt;/th&gt; &lt;th&gt; @Html.DisplayNameFor(model =&gt; model.MANUFACTURING_DATE) &lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; @foreach (var item in Model) { &lt;tr&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.EPC_NUMBER) &lt;/td&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.PRODUCT_NAME) &lt;/td&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.MANUFACTURING_DATE) &lt;/td&gt; &lt;/tr&gt; } &lt;/table&gt; </code></pre> <p>What I want to do now : ling the 2 in the same view. When I click on the details button, a function of my controller is called with the product.id as parameter then display the details of the product. How to do what I want ? Thanks ! </p>
    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