From ccba65247b12db4e30de11845c420c7abc9c7491 Mon Sep 17 00:00:00 2001 From: "jason.zhu" Date: Tue, 22 Jun 2021 13:14:44 +1000 Subject: [PATCH] Modify controller to take parameters --- MvcMusicStore/Controllers/StoreController.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/MvcMusicStore/Controllers/StoreController.cs b/MvcMusicStore/Controllers/StoreController.cs index db9df78..89c3bdd 100644 --- a/MvcMusicStore/Controllers/StoreController.cs +++ b/MvcMusicStore/Controllers/StoreController.cs @@ -14,16 +14,18 @@ namespace MvcMusicStore.Controllers return "Hello from Store.Index()"; } // - // GET: /Store/Browse - public string Browse() + // GET: /Store/Browse?genre=?Disco + public string Browse(string genre) { - return "Hello from Store.Browse()"; + string message = HttpUtility.HtmlEncode("Store.Browse, Genre is " + genre); + return message; } // - // GET: /Store/Details - public string Details() + // GET: /Store/Details/5 + public string Details(int id) { - return "Hello from Store.Details()"; + string message = "Store.Details, ID = " + id; + return message; } } } \ No newline at end of file