AjaxItemSelect.Controllers.TracksController.Albums C# (CSharp) Метод

Albums() публичный Метод

public Albums ( int id ) : System.Web.Mvc.ActionResult
id int
Результат System.Web.Mvc.ActionResult
        public ActionResult Albums(int? id)
        {
            // Fetch the collection
            var c = m.AlbumGetAllForArtist(id.GetValueOrDefault());

            // If null, create an empty collection
            if (c == null) { c = new List<AlbumBase>(); }

            // Create a form
            var form = new AlbumForm();
            form.AlbumList = new SelectList(c, dataValueField: "AlbumId", dataTextField: "Title");

            return PartialView("_AlbumList", form);

            // Attention - 08 - Notice several things in the list-of-albums view...
            // The dropdown list has an "onchange" attribute that calls a JavaScript method

            // Attention - 09 - Study the albumSelected() method in the JavaScript core.js source code file
        }