I am sending data through HttpClient (Json) from console app to web app, everything is working well but the only issue Iam facing that data sent from controller to view is not displayed. I debugged the program and i can see that data are returned to the view. Following are the codes:
Constroller:
using ( var db = new MessageDBContext())
{
try
{
db.Messages.Add(model);
db.SaveChanges();
}
catch (DbEntityValidationException e)
{
Debug.WriteLine("Saving Messages into db Error 1: " + e.EntityValidationErrors);
}
}
return View(model);
Controller Debugg:
and here is the view code:
<table class="table table-striped">
<thead>
<tr>
<th>Message</th>
<th>Time</th>
</tr>
</thead>
<tbody>
@if (Model != null)
{
<tr>
<td>
@Html.Display(@Model.message)
</td>
<td>
@Html.Display(@Model.time)
</td>
</tr>
}
</tbody>
</table>
View Debugg:
So why the data are not displayed to the html view!?


Html.Displayhelper, why not simply write out the result<td>@Model.message</td>