@if (ViewBag.Action == "Edit")
{
@Html.DropDownList("Conf_Type", ViewBag.Assets_Type as SelectList, new { @class = "form-control" })
}
else
@Html.DropDownList("Conf_Type", ViewBag.Assets_Type as SelectList, "Select Type", new { required = "required", validationmessage = "Please select Type", selected = @Model.Assets_Type, @class = "form-control" })
public ActionResult Index(int? id)
VarsityContext VarsityDB = new VarsityContext();
Varsity.Models.Configuration configuration = new Varsity.Models.Configuration();
try
TempData["Asset Inventory"] = "Asset Inventory";
if (id != null)
configuration = VarsityDB.Configurations.Single(a => a.Conf_ID == id);
ViewBag.Action = "Edit";
ViewBag.Action = "Create";
IEnumerable<SelectListItem> basetypes = new SelectList(cwConfiguration.getConfigurationTypes(), "Id", "Name", configuration.Conf_Type);
ViewBag.Conf_Type = basetypes;
catch (Exception ex)
{ }
return View(configuration);