Is it possible to switch DisplayTemplate like below when we consume in different cshtml pages? Data1 and Data2 are two cshtml DisplayTemplates but referring same Data1 model.
If we are using without template name, its working and taking the Data1 template.
cshtml1.
DisplayFor(m=>m.Data1List,"Data1")
cshtml2.
DisplayFor(m=>m.Data1List,"Data2")
I have received error like below when I tried this. but its working when I have only the first one.
System.InvalidOperationException
HResult=0x80131509
Message=The model item passed into the dictionary is of type 'System.Collections.Generic.List`1
User contributions licensed under CC BY-SA 3.0