// GET: Tracks/Tracks/5
        // Attention - 10 - This get-tracks-for-album method is called from JavaScript+Ajax
        public ActionResult Tracks(int? id)
        {
            // Fetch the collection
            var c = m.TrackGetAllForAlbum(id.GetValueOrDefault());

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

            // Create a form
            var form = new TrackForm();
            form.TrackList = new SelectList(c, dataValueField: "TrackId", dataTextField: "Name");

            return PartialView("_TrackList", form);

            // Attention - 11 - Look at the list-of-tracks view
        }
Beispiel #2
0
        // GET: Tracks/Tracks/5
        // Attention - 10 - This get-tracks-for-album method is called from JavaScript+Ajax
        public ActionResult Tracks(int?id)
        {
            // Fetch the collection
            var c = m.TrackGetAllForAlbum(id.GetValueOrDefault());

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

            // Create a form
            var form = new TrackForm();

            form.TrackList = new SelectList(c, dataValueField: "TrackId", dataTextField: "Name");

            return(PartialView("_TrackList", form));

            // Attention - 11 - Look at the list-of-tracks view
        }