Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
an expression may not contain a dynamic operation in MVC
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Sai Prasad Anumolu
10y
921
1
Reply
Error in View :
Model Is
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace BorbaneApplication.Model
{
public class Country
{
public string CountryCode { get; set; }
public string CountryName { get; set; }
}
}
View is :
@using BorbaneApplication.Model;
@model BorbaneApplication.Model.Country;
@{
ViewBag.Title = "DisplayTable";
}
<h2>DisplayTable</h2>
<div>
<table>
<tr>
<th>Country Code</th>
<th>Country Name</th>
<th>Operations</th>
</tr>
@foreach(var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelitem =>item.CountryCode)
</td>
<td>
@Html.DisplayFor(modelitem=>item.CountryName)
</td>
</tr>
}
</table>
</div>
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
how do I we get to know which all the check box's are TICKED
New Website