Background Pass Value
list<configparaminfo> paramlist = Configparambll.getmodellist ("and parentid=1"); viewdata["UserState"] = new SelectList (paramlist, "value", "name");
Front Page
@Html. DropDownList ("userstate", viewdata["userstate"] as SelectList, "--Please select--", new {@class = "Form-control input-sm"})
//Abstract: // use the specified HTML Helper, the form linked fields, the specified list items, the options tag, and the specified HTML, to return a single select item. //// Parameters:////HtmlHelper:// This method is an expanded HTML Helper. //// Name: // linked fields-bit name of the form to be returned. ///// selectlist: A collection of System.Web.Mvc.SelectListItem objects that are used to fill in the drop-down checklist. ///// Optionlabel:// Preset blank text for the purpose. This can be null. //// htmlattributes: // object containing the HTML that is to be set for the item. //// Fax: // HTML Select item, where each item in the list contains an option sub-item. ///// Exceptions:/ / System.ArgumentException: // The name parameters are null or blank. Public static mvchtmlstring DropDownList (This htmlhelper htmlhelper, string name, Ienumerable<selectlistitem > SelectList, String Optionlabel, Object htmlattributes);
ASP. NET MVC page value--DropDownList