-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from ignatandrei/109-saferouting
109 saferouting
- Loading branch information
Showing
119 changed files
with
77,753 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
|
||
<h1>RSCG nr 60 : SafeRouting</h1> | ||
|
||
<h2>Info</h2> | ||
Nuget : <a href="https://www.nuget.org/packages/SafeRouting/" target="_blank">https://www.nuget.org/packages/SafeRouting/</a> | ||
|
||
<p>You can find more details at : <a href="https://github.com/daviddotcs/safe-routing" target="_blank"> https://github.com/daviddotcs/safe-routing</a></p> | ||
|
||
<p>Author :David Wake</p> | ||
|
||
<p>Source : <a href="https://github.com/daviddotcs/safe-routing" target="_blank">https://github.com/daviddotcs/safe-routing</a> </p> | ||
|
||
<h2>About</h2> | ||
|
||
Safe Routing for MVC | ||
|
||
<h2> | ||
How to use | ||
</h2> | ||
<h3> | ||
Add reference to the <a href="https://www.nuget.org/packages/SafeRouting/" target="_blank">SafeRouting</a> in the csproj | ||
</h3> | ||
<img src="images/SafeRouting/SafeRoutingDemo.csproj.png" width="580" height="580" /> | ||
|
||
<h3>This was for me the <b>starting</b> code</h3> | ||
|
||
<br /> | ||
I have <b>coded</b> the file _ViewImports.cshtml | ||
<br /> | ||
<img src="images/SafeRouting/csFiles/_ViewImports.cshtml.png" width="580" height="580" /> | ||
<hr /> | ||
|
||
<br /> | ||
I have <b>coded</b> the file _Layout.cshtml | ||
<br /> | ||
<img src="images/SafeRouting/csFiles/_Layout.cshtml.png" width="580" height="580" /> | ||
<hr /> | ||
<h3>And here are the <i>generated</i> files</h3> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views_Home_Index_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views_Home_Index_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views_Home_Privacy_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views_Home_Privacy_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views_Shared_Error_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views_Shared_Error_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views_Shared__Layout_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views_Shared__Layout_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views_Shared__ValidationScriptsPartial_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views_Shared__ValidationScriptsPartial_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views__ViewImports_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views__ViewImports_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is Views__ViewStart_cshtml.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/Views__ViewStart_cshtml.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is ControllerRoutes.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/ControllerRoutes.g.cs.png" width="580" height="580" /> | ||
|
||
<br /> | ||
The file <i>generated</i> is globalusings.g.cs | ||
<br /> | ||
<img src="images/SafeRouting/generated/globalusings.g.cs.png" width="580" height="580" /> | ||
|
||
<p> | ||
You can download the code and this page as pdf from | ||
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/SafeRouting'> | ||
https://ignatandrei.github.io/RSCG_Examples/v2/docs/SafeRouting | ||
</a> | ||
</p> | ||
|
||
|
||
<p> | ||
You can see the whole list at | ||
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'> | ||
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG | ||
</a> | ||
</p> | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
v2/book/examples/images/SafeRouting/SafeRoutingDemo.csproj.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="SafeRouting" Version="1.4.0" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath> | ||
</PropertyGroup> | ||
</Project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions
54
v2/book/examples/images/SafeRouting/csFiles/_Layout.cshtml.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@{ | ||
var privacy = Routes.Controllers.Home.Privacy(); | ||
|
||
} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"] - SafeRoutingDemo</title> | ||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> | ||
<link rel="stylesheet" href="~/SafeRoutingDemo.styles.css" asp-append-version="true" /> | ||
</head> | ||
<body> | ||
<header> | ||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3"> | ||
<div class="container-fluid"> | ||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SafeRoutingDemo</a> | ||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent" | ||
aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between"> | ||
<ul class="navbar-nav flex-grow-1"> | ||
<li class="nav-item"> | ||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> | ||
<a for-route="privacy">!New Privacy!</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</header> | ||
<div class="container"> | ||
<main role="main" class="pb-3"> | ||
@RenderBody() | ||
</main> | ||
</div> | ||
|
||
<footer class="border-top footer text-muted"> | ||
<div class="container"> | ||
© 2023 - SafeRoutingDemo - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a> | ||
</div> | ||
</footer> | ||
<script src="~/lib/jquery/dist/jquery.min.js"></script> | ||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
@await RenderSectionAsync("Scripts", required: false) | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
v2/book/examples/images/SafeRouting/csFiles/_ViewImports.cshtml.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@using SafeRoutingDemo | ||
@using SafeRoutingDemo.Models | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
@addTagHelper SafeRouting.TagHelpers.*, SafeRouting.Common |
Binary file added
BIN
+1.83 MB
v2/book/examples/images/SafeRouting/generated/ControllerRoutes.g.cs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.