<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Carrots.Web.Models.Product>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Index</h2>
<%: Html.ActionLink("Create New", "Create") %>
             
<%: Html.ActionLink("Show All Active Products", "Show") %>
<table>
<tr>
<th>
Name
</th>
<th>
ColliType
</th>
<th>
ProductGroup
</th>
<th>
CurrentLocation
</th>
<th>
AvailableFrom
</th>
<th>
AvailableTo
</th>
<th>
Note
</th>
<th>
UserName
</th>
<th></th>
</tr>
<% foreach (var item in Model) { %>
<tr>
<td>
<%: Html.DisplayFor(modelItem => item.Name) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.ColliType.Name) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.ProductGroup.Name) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.CurrentLocation) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.Country.Name) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.AvailableFrom) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.AvailableTo) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.Note) %>
</td>
<td>
<%: Html.DisplayFor(modelItem => item.UserName) %>
</td>
<td>
<%: Html.ActionLink("Edit", "Edit", new { id=item.ProductID }) %> |
<%: Html.ActionLink("Details", "Details", new { id=item.ProductID }) %> |
<%: Html.ActionLink("Delete", "Delete", new { id=item.ProductID }) %>
<%:Html.ActionLink("PreferedLocation", "selectlocation", new { id = item.ProductID })%>//exception came as id as preferedlocation id but passed productid
</td>
</tr>
<% } %>
</table>
</asp:Content>
when I select preferedlocation(action is selectlocation) I need to create preferedlocation for individual product.
o/p as:
product,
Mango,
textboxes for entering preferedlocation data.
Srujana, if this helps please login to Mark As Answer. | Alert Moderator