Reputation: 6468
I am facing some issue with razor syntax to pass list of string with partial view. Here is my code :
<ul class="nav navbar-nav">
@{ IList<string> model = new List<string> {"nb-NO", "nn-NO", "sv-SE", "da-DK", "en-GB", "se-NO", "fi-FI", "de-DE"}; }
<li>@Html.Partial("_AppLanguage", model)</li>
</ul>
when i execute, it shows me this error:
Can anybody tell me whats the wrong in my code ?
Upvotes: 1
Views: 151
Reputation: 6468
Ok. I got my solution. The issue is not in my razor syntax. The issue was in my _AppLanguage
partial view. There i made a mistake to grub the model. I used @{var model = @Model;}
instead of @{var model = Model;}
Upvotes: 2