Modify controller to take parameters

chap1
jason.zhu 2021-06-22 13:14:44 +10:00
parent 8a27860218
commit ccba65247b
1 changed files with 8 additions and 6 deletions

View File

@ -14,16 +14,18 @@ namespace MvcMusicStore.Controllers
return "Hello from Store.Index()"; return "Hello from Store.Index()";
} }
// //
// GET: /Store/Browse // GET: /Store/Browse?genre=?Disco
public string Browse() public string Browse(string genre)
{ {
return "Hello from Store.Browse()"; string message = HttpUtility.HtmlEncode("Store.Browse, Genre is " + genre);
return message;
} }
// //
// GET: /Store/Details // GET: /Store/Details/5
public string Details() public string Details(int id)
{ {
return "Hello from Store.Details()"; string message = "Store.Details, ID = " + id;
return message;
} }
} }
} }