I have a controller in my MVC sire that has a couple of methods along the lines of the following:
public ActionResult _GetServiceStatus()
{
...
}
public ActionResult _GetEventLogErrors()
{
...
}
Each of these methods references a different class type that I have stored in my Model, Service and Event respectively. These can be seen below:
public class Service
{
public string Name { get; set; }
public string Status { get; set; }
}
public class Event
{
public string Source { get; set; }
public string EntryType { get; set; }
public string Message { get; set; }
public DateTime Date { get; set; }
}
What I want to do is to show the results of these methods on a single view. I already have this working for the Services check, with the results displaying correctly, but I cannot find how to add in the Event results.
What I have currently in my view is below:
@{
ViewBag.Title = "Monitoring";
}
@model IEnumerable<SystemMonitoringTool.Models.Monitoring.Service>
<div style="width:25%">
<span>
Services
</span>
<table id="services" style="border:solid; border-width:2px; width:100%">
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(model => item.Name)
</td>
<td>
@Html.DisplayFor(model => item.Status)
</td>
</tr>
}
</table>
</div>
Can someone help me find a way to display these side by side on the same view? Will be happy to provide more info if needed.