15.6.2 Defining Optional URL Segments; Listinig 15-20. Checking for an Optional Segment Variable in the HomeController.cs File
This commit is contained in:
parent
e43c56e68a
commit
ed932d419f
@ -20,7 +20,7 @@ namespace UrlsAndRoutes.Controllers
|
||||
{
|
||||
ViewBag.Controller = "Home";
|
||||
ViewBag.Action = "CustomVariable";
|
||||
ViewBag.CustomVariable = id;
|
||||
ViewBag.CustomVariable = id ?? "<no value>";
|
||||
return View();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user