I am getting a runtime error, saying that I am missing a closing paren. The error occurs on the line where I set emailText
This code works in MVC 3 but not MVC 4. I know the new Razor is more strict but syntactically this code still looks right. All parens match, etc.
Any ideas?
@if (Model.Counselors != null)
{
for (var i = 0; i < Model.Counselors.Count; i++)
{
string counselorDivId = "counselorname" + i.ToString();
string deleteLink = "<a class=\"icon delete counselor\" data-attr-divid=\"" + @counselorDivId + "\" data-attr-id=" + @Model.Counselors[i].Id + " style=\"float:right;\"></a>";
string emailText = (!String.IsNullOrEmpty(Model.Counselors[i].CounselorContactEmail) ? (Model.Counselors[i].CounselorContactEmail.Length < 29 ? Model.Counselors[i].CounselorContactEmail : "Email " + Model.Counselors[i].CounselorContactName) : "");
}
}
try