Mvc DropDownlist Semicolon issue with razor
This is the code am using to bind my drop down and razor is expecting ; at
the end as mentioned below
@{
ViewBag.test = Model.Sample.Select(o => new SelectListItem
{
Text = o.Name,
Value = o.sampleId.ToString()
}
);
}
But when drop down is rendered am getting ; next to my Drop down in UI
if i remove the semicolon am getting yellow screen compilation error
Am i doing something wrong ?
No comments:
Post a Comment