mirror of
https://github.com/rudollee/LearningMVC.git
synced 2026-08-11 16:32:55 +00:00
Ch. 16 Routing Adv (until 16-21)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
@model string
|
||||
@{
|
||||
ViewBag.Title = "GetLegacyURL";
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<h2>GetLegacyURL</h2>
|
||||
|
||||
The URL requested was: @Model
|
||||
|
||||
@@ -12,11 +12,25 @@
|
||||
<body>
|
||||
<div>The controller is: @ViewBag.Controller</div>
|
||||
<div>The action is: @ViewBag.Action</div>
|
||||
<div>
|
||||
@Html.ActionLink("This is an outgoing URL", "CustomVariable")
|
||||
</div>
|
||||
<div>
|
||||
@*<div>
|
||||
@Html.ActionLink("This is an outgoing URL", "CustomVariable", new { id = "Hello" })
|
||||
</div>*@
|
||||
@*<div>
|
||||
@Html.ActionLink("This targets another controller", "Index", "Customer")
|
||||
</div>*@
|
||||
<div>
|
||||
<!-- Add Attribute-->
|
||||
@* @Html.ActionLink("This is an outgoing URL", "Index", "Home", null, new { id = "myAnchorID", @class = "myCSSClass" })*@
|
||||
|
||||
<!-- Regular Expression-->
|
||||
@*@Html.ActionLink("This is an outgoing URL", "Index", "Home", "https", "myserver.mydomain.com", "myFragmentName",
|
||||
new { id = "MyId" },
|
||||
new { id = "myAnchorID", @class = "myCSSClass" })*@
|
||||
|
||||
<!-- Show URL without html-->
|
||||
This is a URL:
|
||||
@*@Url.Action("Index", "Home", new { id = "MyId" })*@
|
||||
@Html.ActionLink("Click me", "GetLegacyURL", new { legacyURL = "~/articls/Windows_3.1_Overview.html" })
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user