skip to Main Content

Getting System.Web.Mvc.SelectListItem as options of DropDownList – Asp.net

I have a ViewBag.CategoryList which contains ViewBag.CategoryList = new SelectList(Category.GetCategories()); My View: @Html.LabelFor(model => model.Category, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.DropDownListFor(model => model.Category, new SelectList(ViewBag.CategoryList), "Select Category", htmlAttributes: new {@class = "form-control"}) What I'm getting is <option>System.Web.Mvc.SelectListItem</option>…

VIEW QUESTION

Passing array into query string – Asp.net

I need to send array as query parameter, I do it like this StringBuilder Ids = new StringBuilder(); for (int i = 0; i < array.Count; i++) { Ids.Append(String.Format("&id[{0}]={1}", i, items[i].ID)); } ifrDocuments.Attributes.Add("src", "Download.aspx?arrayCount=" + array.Count + Ids); After this…

VIEW QUESTION
Back To Top
Search