BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
var lstCountry = new SelectList(new[] { new { ID = "AR", Name = "Argentina"}, new { ID = "AT", Name = "Austria"}, new { ID = "AU", Name = "Australia"}, }, "ID", "Name"); ViewBag.lstC = lstCountry; return View();
[CSHTML]
@Html.EJ().ListBox("listboxsample").Datasource((IEnumerable<SelectListItem>)ViewBag.lstC).ListBoxFields(lf=> lf.Text("Text").Value("Value"))
[C#]
public ActionResult Index()
{
var lstCountry = new SelectList(new[]
{
new { ID = "AR", Name = "Argentina"},
new { ID = "AT", Name = "Austria"},
new { ID = "AU", Name = "Australia"},
}, "ID", "Name").ToList<SelectListItem>();
ViewBag.lstC = lstCountry;
return View();
} |