
04-24-2012, 12:42 PM
|
|
Freshman
|
|
Join Date: Jun 2008
Posts: 33
|
|
ASP.NET MVC3 Models that are Collections
|
I am new to ASP.NET MVC. I am trying to work on a project where the <HttpPost()> method in my Controller takes a parameter that is a collection model.
Code:
<HttpPost()>
Public Function MyDiariesSearch(ByVal datMyDiaries As MyDiaries) As ViewResult
Return View("MyDiariesResults", datMyDiaries.GetResults(p_iStaffID))
End Function
Diaries is defined as such:
Code:
Public Class MyDiaries
Inherits List(Of Diary)
.......
Everytime the MyDiariesSearch method fires "datMyDiaries" is coming back as Nothing.
If I remove the "Inherits List(Of Diary)" line in my MyDiaries class it seems to work alright but then it truly isn't a collection class.
Is there something I'm missing? Is there a way to have a Model that is really a collection of objects?
|
|