MVC5 Bootstrap collapsible with dynamic class - asp.net-mvc

I am having my view bound to datatable as follows
#{int i = 1;}
#foreach (var item in Model.Rows)
{
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading bg-info">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse#(i)">
<div class="col-lg-3">
<img style="width:50px" class="float-left p-l-5" src="https://organicthemes.com/demo/profile/files/2012/12/profile_img.png" /> <div class="float-left p-l-10">
<h4 class="m-t-0">#item["First_Name"]</h4>
<p><b>##item["Employee_Code"]</b></p>
</div>
</div>
<div class="col-lg-4">
<h4 class="m-t-0">#item["Leave_Description"]: #item["No_Of_Days"] days - <span class="blue_heading">#item["Start_date"]</span></h4>
<h4 class="m-t-0">#item["Leave_Purpose"]</h4>
</div>
<div class="col-lg-4">
</div>
</a>
</div>
<div id="collapse#(i)" class="panel-collapse collapse">
<div class="panel-body">
<div class="center_table">
<div class="border_table">
<table class="table table-hover table-expandable table-striped">
<tr>
<td>
Leave Type: #item["Leave_Description"]
</td>
<td>
Days : #item["No_Of_Days"]
</td>
</tr>
<tr>
<td>
From : #item["Start_Date"]
</td>
<td>
To : #item["End_Date"]
</td>
</tr>
<tr>
<td colspan="2">Reason : #item["Leave_Purpose"]</td>
</tr>
</table>
</div>
<div class="clearfix"></div>
<div class="well text-center p-10"><button type="button" class="btn btn-default">Accept Grant</button> <button type="button" class="btn btn-default">Reject</button></div>
</div>
</div>
</div>
</div>
</div>
i++;
}
I am getting the required output but when clicking on first row the second row is also showing as collapsed. My scenario is when there are multiple rows on clicking a particular row other rows collapse should be hidden.
Can someone tell what change do I need to achieve the scenario?

Can you try
i=i+1;
Sometime foreach confuses with ++ operator
Also you can try collapse-#i instead of #collapse#(i)

Related

asp.Net Core ViewComponent doesn't show CSS

I'm trying to get to grips with ViewComponents but having trouble trying to get the ViewComponent to reload on a button click. Whats the correct way to handle this?
Initially on the page loading it looks OK like this
In my controller I have
public IActionResult ReloadViewComponent(int characterRegionId, int materialTypeId)
{
return ViewComponent("MarketOrderComponent", new { characterRegionId, materialTypeId});
}
and in my razor view I'm passing parameters to the ReloadViewComponent method
<td><button class="btn btn-sm btn-outline-primary" value="#material.MaterialTypeID" onclick="location.href='#Url.Action("ReloadViewComponent", "BlueprintBreakdown", new { Model.CharacterRegionId, material.MaterialTypeID })'">View</button></td>
full razor view
<body>
<div class="row" style="margin-top:5px;">
<div class="col-lg-4 col-md-12">
<div class="card" style="margin-bottom:0; ">
<div class="header" style="margin-bottom:55px;">
<h2 class="text-primary">Blueprint Breakdown</h2>
</div>
<div class="body">
<div>
<h5 class="text-center">#Model.BlueprintName</h5>
</div>
<div class="row text-center">
<div class="col-6 border-right pb-4 pt-4" style="padding-top:0px !important; padding-bottom:0px !important;">
<img src="#Model.ImageUrl" alt="#Model.BlueprintName">
</div>
<div class="col-6 pb-4 pt-4" style="padding-top:0px !important; padding-bottom:0px !important;">
<img src="#Model.ProductImageUrl" alt="#Model.BlueprintName">
</div>
</div>
<div class="text-center" style="margin-top:5px;">
<text style="font-size:small;">Material Quantity Based on Manufacturing Efficiency</text>
<br />
<text style="font-size:small;">Price Based on Lowest Region Market Sell Orders</text>
<br />
<text style="font-size:small;">Current Region is <span class="text-green">#Model.CharacterRegionName</span></text>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover table-custom spacing5">
<thead>
<tr>
<th></th>
<th>Material</th>
<th>Quantity</th>
<th>Price</th>
<th>Market</th>
</tr>
</thead>
<tbody>
#foreach (var material in Model.RequiredMaterials)
{
<tr class="text-cente" style="font-size:small;">
<td><img src="#(String.Format("{0}{1}{2}", "https://imageserver.eveonline.com/Type/", material.MaterialTypeID, "_32.png"))" /></td>
<td>#material.TypeName</td>
<td>#material.Quantity</td>
<td>#material.MaterialCost</td>
<td><button class="btn btn-sm btn-outline-primary" value="#material.MaterialTypeID" onclick="location.href='#Url.Action("ReloadViewComponent", "BlueprintBreakdown", new { Model.CharacterRegionId, material.MaterialTypeID })'">View</button></td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="col-lg-8 col-md-12">
#await Component.InvokeAsync("MarketOrderComponent", new { Model.CharacterRegionId, Model.RequiredMaterials.First().MaterialTypeID })
</div>
</div>
but when clicking the view button to reload the ViewComponent it is rendered like this.
Note by using the ViewComponent() controller method, your client only gets the component part of the view. So instead of changing the browser's current location, you should send an ajax request and dynamically replace the right side content.
Add an id='MarketOrderComponent'attribute so that we can reference this element later:
<div id='MarketOrderComponent' class="col-lg-8 col-md-12">
#await Component.InvokeAsync("MarketOrderComponent", new { Model.CharacterRegionId, Model.RequiredMaterials.First().MaterialTypeID })
</div>
And change the button click event handler to send an ajax request. For example, in order to reload the market order component, you can change your code as below:
<script>
function reload(url){
return $.ajax({
method:"get",
url:url,
success:function(resp){ $('#MarketOrderComponent').html(resp);},
});
}
</script>
<div class="card" style="margin-bottom:0; ">
...
</div>
<div class="table-responsive">
...
<tbody>
#foreach (var material in Model.RequiredMaterials)
{
<tr class="text-cente" style="font-size:small;">
<td><img src="#(String.Format("{0}{1}{2}", "https://imageserver.eveonline.com/Type/", material.MaterialTypeID, "_32.png"))" /></td>
<td>#material.TypeName</td>
<td>#material.Quantity</td>
<td>#material.MaterialCost</td>
<td>
<button class="btn btn-sm btn-outline-primary"
value="#material.MaterialTypeID"
onclick="var link='#Url.Action("ReloadViewComponent", "BlueprintBreakdown", new { Model.CharacterRegionId, material.MaterialTypeID })'; event.preventDefault(); reload(link)"
>
View
</button>
</td>
</tr>
}
</tbody>
...
</div>
<div id='MarketOrderComponent' class="col-lg-8 col-md-12">
#await Component.InvokeAsync("MarketOrderComponent", new { Model.CharacterRegionId, Model.RequiredMaterials.First().MaterialTypeID })
</div>

View/open file url

I have a view that creates a document with a Title, Date, and name of file that I upload. Once that document is created it is returned to a View that shows the document that I just created and is stored in a database.
Here is the code that creates the document:
<form asp-action="CreateDirectorDocument" role="form" class="form-
horizontal">
<div asp-validation-summary="ModelOnly" class="alert-
danger text-danger"></div>
<div class="form-group">
<div class="col-md-10"><a asp-
action="Index">View Documents</a></div>
</div>
<div class="form-group">
<div class="col-md-10"><label asp-for="Date">
</label></div>
<div class="col-sm-2"><input asp-for="Date" />
</div>
</div>
<div class="form-group">
<div class="col-md-2"><label asp-
for="DocFile"></label></div>
<div class="col-md-4">
<input asp-for="DocFile" type="file"
multiple>
</div>
</div>
<div class="form-group">
<div class="col-sm-2"><label asp-for="Title">
</label></div>
<div class="col-sm-2"><input asp-for="Title"
/></div>
</div>
</form>
View that is return after document has been created:
<table>
<thead>
<tr>
<th class="col-md-2" style="border-bottom: solid">
</th>
<th class="col-md-2" style="border-bottom:
solid">Title</th>
<th class="col-md-2" style="border-bottom:
solid">Date</th>
<th class="col-md-2" style="border-bottom: solid">
</th>
</tr>
</thead>
<tbody>
#foreach (var dirDocs in Model.Docs)
{
<tr>
<td class="col-md-2">
<a asp-area="Admin" asp-controller="Docs"
asp-action="EditDirectorDocument" asp-route-
id="#dirDocs.Id">Edit</a>
<a asp-area="Admin" asp-controller="Docs"
asp-action="DeleteDirectorDocument" asp-route-
returnViewName="#returnViewName" asp-route-id="#dirDocs.Id"
onclick="return confirm('Are you sure you want to delete
this document?');">Delete</a>
</td>
<td class="col-md-2">#dirDocs.Title</td>
<td class="col-md-2">#dirDocs.Date</td>
<td class="col-md-2"><a asp-route-
id="#dirDocs.Url" target="_blank">Open</a></td>
</tr>
}
</tbody>
</table>
The file that is uploaded gets stored as a document file and is created as a url for the user to view. How do I do this in MVC. Is that set up in the controller? If so how is that done?
Not sure, but I think you just need:
Open
Instead of
<a asp-route-id="#dirDocs.Url" target="_blank">Open</a>
I assume you mean you get a URL back from the upload process that you want to display to the user so they can click on it and see the file they uploaded.
If you wanted to display some thing like that inline you could probably use an iframe whose src is set to #dirDocs.Url:
<iframe src="#dirDocs.Url"></iframe>

Displaying a Modal in Partial View in Asp.net Mvc

After clicking "Advanced search" button i want to open a modal from a partial view where i can apply custom search
Here is my Index.cshtml page for showing data table
#model SmartAdmission.Web.Areas.Admin.Models.InstituteViewModel
#{
ViewBag.Title = "Index";
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Program Level List</h3>
</div>
<div class="box-body">
#if (TempData["Message"] != null)
{
<div class="alert alert-#TempData["alertType"]">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
#TempData["Message"]
</div>
}
#*<input type="hidden" id="hiddenProvinceId" />*#
<table id="instituteTable" class="table table-bordered table-striped">
<thead>
<tr>
<th>
<button type="button"
class="btn btn-default btn-md" data-toggle="modal"
data-target="#advancedSearchModal"
id="advancedsearch-button">
<span class="glyphicon glyphicon-search"
aria-hidden="true"></span> Advanced Search
</button>
</th>
</tr>
<tr>
<th>Institute Name</th>
<th>Province</th>
<th>Course Name</th>
<th>Program Level</th>
<th>Tution Fee</th>
<th>Ielts</th>
<th>Action</th>
</tr>
</thead>
<tbody>
#{
foreach (var institute in Model.Institutes)
{
<tr>
<td>
#Html.DisplayFor(m => institute.InstituteName)
</td>
<td>
#Html.DisplayFor(m => institute.Province.Name)
</td>
#foreach (var discipline in institute.Disciplines)
{
foreach (var course in discipline.Courses)
{
<td>
#Html.DisplayFor(m => course.CourseName)
</td>
<td>
#Html.DisplayFor(m => course.ProgramLevel.Name)
</td>
<td>
#Html.DisplayFor(m => course.TutionFeePerYear)
</td>
<td>
#Html.DisplayFor(m => course.IeltsMinRequirement)
</td>
}
}
<td>
<a href="#Url.Action("EditInstitute", "Institute" , new { id = institute.Id }, null)" class="btn">
<i class="glyphicon glyphicon-edit"></i>
</a>
<i class="glyphicon glyphicon-trash"></i>
</td>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="/Admin/Institute/DeleteInstitute" method="post">
<div class="modal-header">
<h5 class="modal-title">Delete Item</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Do you want to delete this record?</p>
<input type="hidden" id="id" name="id" value="" />
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger">Yes, Delete!</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
#section scripts
{
<script>
$(document).ready(function () {
$('#instituteTable').DataTable()
});
$(function () {
$("#mydialog").dialog({
modal: true,
width: "800px",
autoOpen: false
});
});
function ConfirmDelete(id) {
$("#id").val(id);
$('.modal').modal('show');
}
</script>
}
This is my partial view
#model SmartAdmission.Web.Areas.Admin.Models.AdvanceSearchModel
<div id="advancedSearchModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="/Admin/Institute/GetCustomInstitute" method="post">
<div class="modal-header">
<h5 class="modal-title">Advance Search</h5>
#*<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>*#
</div>
<div class="modal-body">
#Html.TextBoxFor(m=>m.InstituteName)
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger">Yes, Delete!</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</form>
</div>
</div>
</div>
i have tried ajax call on button click and refer the url to the action which return a partial view but that didn't work for me.

Navigation broken in Sitecore Page Editor during Edit related item

After updating Sitecore 6.3 to 6.6, the Main Navigation is broken in the Sitecore Page Editor when "Edit related item" is clicked.
It looks like this:
It even stays like this when closing the "Edit related item" frame.
Here is the text from that screen:
{"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{78EBD797-ACA9-40BC-9ACE-961CD2296CDC}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}KATA {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{F195AD36-86EE-4C13-883B-761E300C23AF}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}REA {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{63438A98-FC6F-461D-89BB-7497B12FBAEF}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Patientensicherheit {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{FB9B0590-E933-4141-BA2B-F82C83A3343E}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Prozesse {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{0F1334E0-9BB7-4657-9DC4-884F6E1133C9}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Dokumente {"commands":[{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"","icon":"/~/icon/SoftwareV2/16x16/cubes_blue.png.aspx","isDivider":false,"tooltip":"Dieses Item im Content Editor bearbeiten.","type":"common"}],"contextItemUri":"sitecore://master/{8D18489B-B7F3-442B-9958-7D1FDBDC9010}?lang=de-CH&ver=1","custom":{},"displayName":"Title","expandedDisplayName":null}Telefonlisten
Anyone knows what this is and how I can fix it?
Thanks in advance :)
EDIT:
Code of .ascx:
<%# Control Language="C#" AutoEventWireup="true"
CodeBehind="Header.ascx.cs" Inherits="ZGKS.Intranet.WebApp.Frontend.sublayouts.Header" %>
<%# Register Src="NavLayer.ascx" TagName="NavLayer" TagPrefix="uc1" %>
<%# Register Src="~/Frontend/sublayouts/SearchBox.ascx" TagName="SearchBox" TagPrefix="ZGKSControls" %>
<div class="head">
<div class="line">
<div class="unit sizeCol">
<!-- mod NavService -->
<div class="mod modNavService skinNavServiceHome">
<div class="inner">
<div class="bd">
<ul>
<li>Home</li>
<li><span>
<asp:Literal ID="litWelcome" runat="server"></asp:Literal>
<asp:Literal ID="litUsername" runat="server"></asp:Literal></span></li>
<li class="last"><span>
<asp:Literal ID="litDate" runat="server"></asp:Literal></span></li>
</ul>
</div>
</div>
</div>
<!-- /mod NavService -->
<!-- mod NavService -->
<div class="mod modNavService">
<div class="inner">
<!-- tpl NavService-navservice -->
<div class="bd">
<ul>
<asp:Literal ID="litNaviLinks" runat="server"></asp:Literal>
</ul>
</div>
<!-- /tpl NavService-navservice -->
</div>
</div>
<!-- /mod NavService -->
<!-- mod Favourites -->
<div class="mod modFavourites">
<div class="inner">
<!-- tpl Favourites-favourites -->
<div class="hd">
<ul>
<li>Meine Favoriten
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblFavoritesDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptFavorite" runat="server" OnItemCommand="RptFavoriteItemCommand">
<ItemTemplate>
<tr class="favoritemark">
<td>
<a href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
<td class="delete">
<span>
<asp:ImageButton ToolTip="Löschen" AlternateText="Löschen" ID="btnDeleteFav" runat="server"
CommandName="delFav" CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Frontend/Images/icons/clear.png" />
</span>
</td>
<td class="edit" title="Editieren">
<span></span>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</li>
<li>Meine Systeme
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblSystemDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptSysteme" runat="server">
<ItemTemplate>
<tr class="">
<td>
<a target="_blank" href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<div class="modContent" style="padding: 0;">
<div style="margin: 10px 0; margin-left: 10px;">
<a target="_self" href='<%# MySystemLink %>' class="icon back" title="Zurück">
<span>Meine Systeme bearbeiten</span>
</a>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</div>
</li>
<li>Meine Alerts
<div class="favnavcontainer">
<div class="wrap">
<div class="list">
<table>
<tbody>
<tr>
<td>
<asp:Label ID="lblAlertDescription" runat="server" />
</td>
</tr>
</tbody>
</table>
<table class="highlight">
<tbody>
<asp:Repeater ID="rptAlert" runat="server" OnItemCommand="RptAlertItemCommand">
<ItemTemplate>
<tr class="alertmark">
<td>
<a href="<%# Eval("Url") %>">
<%# Eval("Title") %></a>
</td>
<td class="delete">
<span>
<asp:ImageButton ToolTip="Löschen" AlternateText="Löschen" ID="btnDeleteAlert" runat="server"
CommandName="delAlert" CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Frontend/Images/icons/clear.png" />
</span>
</td>
<td class="edit" title="Editieren">
<span> </span>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</tbody>
</table>
</div>
</div>
<a class="close" title="" href="#">Schliessen <span>|</span> X</a>
</div>
</li>
</ul>
</div>
<div class="bd">
</div>
<!-- /tpl Favourites-favourites -->
</div>
</div>
<!-- /mod Favourites -->
</div>
<div class="unit sizeCol lastUnit">
<div class="line">
<!-- mod Logo -->
<div class="mod modLogo">
<div class="inner">
<!-- tpl Logo-logo -->
<div class="bd">
<a href="/" title="">
<img class="screen" src="/Frontend/Images/logo.gif" width="291" height="27" alt="ZGKS"></a>
</div>
<!-- /tpl Logo-logo -->
</div>
</div>
</div>
<div class="line">
<ZGKSControls:SearchBox ID="SearchBox" runat="server" />
</div>
</div>
<div class="line">
<div class="unit size1of1">
<uc1:NavLayer ID="NavLayer1" runat="server" />
</div>
</div>
</div>
</div>
The issue is due to changes in the webedit.css stylesheet in Sitecore 6.6 from previous versions.
Make sure that /website/webedit.css is present in your inetpub folder, that you do not have it checked into your Visual Studio project, i.e it is not overwriting with a previous version of the file from your source control.

How Do I solve "Sequence contains no elements" error

I have an index view that gets a parameter from an Action link. Sometimes there won't be a record and in that case I want the #Model.Count to simply show 0. That was working just fine. I then need a button to pass that same parameter to a Create view to add a new (initial) record and display on the previous index page. This is where I hit a problem.
<input class="btn btn-sm btn-info" type="button" value="Add To Roster" onclick=" location.href = '#Url.Action("Create", "Enrollments", new {enrollments_CurrentSites = Model.First().Enrollments_CurrentSite}, null)' "/>
If there is no record, instead of showing a count of 0, I now get an error "Sequence Contains No Elements". I thought that maybe there is a null Model and tried to check for it, but no go. If there is one or more records, then the Count is displayed and the "Add To Roster" button performs as expected.
Can someone help me solve this error?
Error Code:
#model IEnumerable<SlamJammersData.Model.Enrollments>
#{
ViewBag.Title = "Rosters";
}
<div class="container-fluid">
<div class="panel panel-info">
<div class="panel-body">
<div class="container">
<div class="row">
#if (Model == null)
{
<h4>Roster count: 0</h4>
}
else
{
<p>
<h4>Roster count: #Model.Count() </h4>
</p>
}
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-2">
<p>
<input class="btn btn-sm btn-info" type="button" value="Add To Roster" onclick=" location.href = '#Url.Action("Create", "Enrollments", new {enrollments_CurrentSites = Model.First().Enrollments_CurrentSite}, null)' "/>
</p>
</div>
<div class="col-sm-2">
<div class="col-sm-2">
<input type="button" class="btn btn-default btn-sm" value="Attendance" />
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div>
<table class="table table-striped table-condensed table-responsive">
<tr>
<th>Player</th>
<th>#Html.DisplayNameFor(model => model.StartTime)</th>
<th></th>
<th></th>
</tr>
#foreach(var item in Model)
{
<tr>
<td>#Html.DisplayFor(modelItem => item.FullName)</td>
<td>#Html.DisplayFor(modelItem => item.StartTime)</td>
<td>
#Html.ActionLink("Details", "Details", new{id = item.Id})
</td>
<td>
#Html.ActionLink("Edit", "Edit", new {id = item.Id})
</td>
</tr>
}
</table>
</div>
</div>
</div>
</div>
</div>
Sending code:
#Html.ActionLink("Rosters", "Index", "Enrollments", new { id = item.Id }, null) |

Resources