I have an MVC application and I have it successfully displaying information from two different tables in one view page in VB.NET. But I am having trouble trying to display information in a details view page with two tables in the application. I think the trouble I am having is with the ID's.
All the information I will be displaying will be about one specific ID, therefore in the view page the modelType will be like this:
@ModelType clientApp.iTracker.ICClass
instead of:
@ModelType IEnumerable(Of clientApp.iTracker.ICClass)
This is because I do not need a foreach to display the information as it should be specific to the ID of the issue.
Currently what I am trying to do is in the controller to get the specific ID selected:
Dim IssTable As IssueTable = dbS.IssueTables.Find(id)
In the previous page I will select the issue in the view like this:
@Html.ActionLink(item.iTable.ProjectTypeID.ToString(), "DetailsIssue", New With {.id = item.iTable.IssueID})
Then in the detailed view I am trying to display the information like this:
@Html.DisplayFor(Function(model) model.iTable.Created)
My class looks like this;
Namespace IssueTracker
Public Class IssueComments
Public cTable As CommentTable
Public iTable As IssTable
End Class
End Namespace
But this is not working. What is the correct way to display information from two tables in a detailed view page in MVC VB.NET?