using System.Collections.Generic;
namespace HelloWorldMvcApp
public class HomeController : Controller
public ActionResult Index()
var model = new SampleViewModel();
model.DropDownCategoryModels = new List<DropDownCategoryModel>{
new DropDownCategoryModel{
new DropDownCategoryModel{
public JsonResult GetNextCategoryDropDownValues(int categoryId)
var subCategories = new List<SelectListItem>();
string prefix = string.Empty;
subCategories.Add(new SelectListItem{
Text = prefix + i.ToString(),
return Json(subCategories);