c# - MVC 5 - Partial view not showing data -
I have a company model as seen below
In the company model, a IQueryable
is EmailHistory (this is the second model)
Public Ent ID {get; Set; } Public String CompanyName {get; Set; } Public IQueryable & lt; IEmailHistory & gt; Email history (get; set;}
In my company's controller I get my company details and get all my email history records, so this is my controller.
// Go to the repository and company record var company records = the repository.gatecompany (transaction.companyID, user.indentity.getUSIID)); // Receive email for this company company.Record.EmailHistory = TheRepository.GetEmailHistoryByCompany (User.Identity.GetUserId (), ID);
If I expand the results at this point in the controller, then I can see the email for the company ... so far everything is fine.
My company's page is a partial view for email history.
@ Html.Partial ("~ / visible / email history / _EmailHistories.cshtml", Model.EmailHistory);
partially looks like this:
@ Model List & lt; AutoSend.Model.EEmailHistory & gt; & Lt; Table class = "table" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th style = "width: 100px" square = "text-left" & gt; From & lt; / Th & gt; & Lt; Th style = "width: 60px" square = "text-left" & gt; Date Sent & lt; / Th & gt; & Lt; Th style = "width: 60px" square = "text-left" & gt; Outcome & lt; / Th & gt; & Lt; Th style = "width: 60px" square = "text-left" & gt; Distributed date & lt; / Th & gt; & Lt; Th style = "width: 60px" square = "text-left" & gt; Date opened & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; @Vrench (Mod E-mail History in Mod) {& lt; Tr & gt; & Lt; Td square = "text-left" & gt; @ Html.Display (emailHistory.EmailAddress) & lt; / Td> & Lt; Td square = "text-left" & gt; @html Display (Email History.SendettoTwo Shortcode String ()) & lt; / Td> & Lt; Td class = "text-left" & gt; @ Html.Display (emailHistory.OutCome) & lt; / Td> & Lt; Td square = "text-left" & gt; @ Html.Display (emailHistory.EmailDeliveredDate.ToShortDateString ()) & lt; / Td> & Lt; Td square = "text-left" & gt; @ Html.Display (emailHistory.EmailOpened.ToShortDateString ()) & lt; / Td> & Lt; / TR & gt; } & Lt; / Tbody & gt; & Lt; / Table & gt;
If I step through this then I can see that we can loop through the email history (and see the values) alright but ..... this page Does not actually present the data (although the related TD is translated)
I can see the headers and rows of the table, but no record is being shown!
How about providing data in TDS without a helpful method .... @emailhistory such as [Yourprop] ....
Comments
Post a Comment