Hello everyone,
This is the Controller,
- string[] arryvalidvalue = new string[] { "Red","Black","White" };
- List
listValidValies = new List (); - foreach (var item in arryvalidvalue)
- {
- listValidValies.Add(new SelectListItem { Text = item, Value = item.ToString() });
- }
- ViewData["arryvalidvalue"] = listValidValies;
- <tr><td>@Html.TextBox(item.AttributeName)td><td>@Html.DropDownList("", ViewData["arryvalidvalue"] as List<SelectListItem>, "Select", new { size = item.AttributeMaxLength })td>tr>
"
An exception of type 'System.ArgumentException' occurred in System.Web.Mvc.dll but was not handled in user code
Additional information: Value cannot be null or empty."
How can I solve this?

Chetan RanpariyaPosted Jan 11, 2017, 10:44 AM
Abhilash J APosted Jan 11, 2017, 11:20 AM
Chetan RanpariyaPosted Jan 11, 2017, 11:15 AM
Abhilash J APosted Jan 11, 2017, 10:51 AM
Abhilash J APosted Jan 11, 2017, 10:30 AM
Chetan RanpariyaPosted Jan 11, 2017, 9:42 AM