public ActionResult GetKeels() { List <Keel> keels = Keel.All(); return(new JsonResult() { Data = keels }); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List <Keel> allKeels = Keel.All(); List <Tuple <string, string> > keelSource = new List <Tuple <string, string> >(); keelSource.Add(new Tuple <string, string>("All", "")); foreach (Keel k in allKeels) { keelSource.Add(new Tuple <string, string>(k.Name, k.Designator)); } ddlKeel.DataSource = keelSource; ddlKeel.DataTextField = "Item1"; ddlKeel.DataValueField = "Item2"; ddlKeel.DataBind(); List <ShipHull> hulls = DataFactory.GetShipHulls(string.Empty); gvHulls.DataSource = hulls; gvHulls.DataBind(); } }