Note that there are some explanatory texts on larger screens.

plurals
  1. POdon't know how to display data into the view (beginner)
    primarykey
    data
    text
    <p>Good Morning everybody.</p> <p>I'm a beginner in .Net languages and need an example to be able to go further.</p> <p>So, my objective is to display dates and comments from a datatable, below general information about a client.</p> <p>The view needs to become something like that :</p> <p>name firstname : adress : phone number : ...</p> <p>date1 comment1</p> <p>date2 comment2 ...</p> <p>It was easy to automatically generate a strongly typed view with the general data. Now, I don't get how to display the comments below.</p> <p>Here is what I've already done into the controller</p> <pre><code> ' GET: /Contacts/Details/5 Function Details(id As Integer) As ActionResult Dim contact As contact = db.contact.Single(Function(c) c.idContact = id) Dim listMeet = New List(Of meeting) listMeet = (From d In db.meeting Where d.FK_meet_contact = id Select d).ToList() ViewBag.listeMeeting = listMeet Return View(contact) End Function </code></pre> <p>Into the view, I dis plenty of wrong things... Let's show you the last one :</p> <pre><code>@ModelType MvcApplication4.contact @Code ViewData("Title") = "Details" Dim list As List(Of Object) = ViewBag.listeMeeting Dim ligne As ListItemCollection End Code </code></pre> <p>[...]</p> <pre><code>&lt;fieldset&gt; &lt;legend&gt;&lt;button onclick="togglefield('Meet')"&gt;Meetings&lt;/button&gt;&lt;/legend&gt; &lt;div class="Meet"&gt; @For Each ligne In ViewBag.listeMeeting @Html.Raw(ViewBag.listeMeeting) Next (ligne) &lt;/div&gt; &lt;/fieldset&gt; </code></pre> <p>What haven't I well understood?</p> <p>ps : I'm not a native english speaker, so, sorry if my english sucks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload