I have a generic List <T> and I want to create a view that iterates through the list and produces output.
I come up with a couple of problems:
- I do not know how to get my view.aspx to understand T
- I do not know how to make it do the right partial for T
For example, if I go to the CustomObject1 list, then I want to display a partial CustomObject1.ascx, and if I go to the CustomObject2 list, I want to display a partial CustomObject2.ascx.
Is there an easy way to do this that I missed? I don’t want to have another aspx variable for every type of list I want to use, I just generate the elements after all. So it is a waste to have 15 different views to cover every type of list that I will need to use.
Any ideas or solutions would be greatly appreciated.
source
share