Organize the website
|  | @ -13,10 +13,15 @@ namespace AspNetCoreMvc.Controllers | |||
| { | ||||
|     public class HomeController : Controller | ||||
|     { | ||||
|         public IActionResult Index() | ||||
|         public IActionResult Index () | ||||
|         { | ||||
|             return View (); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult Clicker () | ||||
|         { | ||||
|             var count = 0; | ||||
|             var head = new Heading { Text = "Ooui!" }; | ||||
|             var head = new Heading { Text = "Click away!" }; | ||||
|             var label = new Label { Text = "0" }; | ||||
|             var btn = new Button { Text = "Increase" }; | ||||
|             btn.Clicked += (sender, e) => { | ||||
|  | @ -30,23 +35,23 @@ namespace AspNetCoreMvc.Controllers | |||
|             return new ElementResult (div); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult About() | ||||
|         public IActionResult About () | ||||
|         { | ||||
|             ViewData["Message"] = "Your application description page."; | ||||
| 
 | ||||
|             return View(); | ||||
|             return View (); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult Contact() | ||||
|         public IActionResult Contact () | ||||
|         { | ||||
|             ViewData["Message"] = "Your contact page."; | ||||
| 
 | ||||
|             return View(); | ||||
|             return View (); | ||||
|         } | ||||
| 
 | ||||
|         public IActionResult Error() | ||||
|         public IActionResult Error () | ||||
|         { | ||||
|             return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); | ||||
|             return View (new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -0,0 +1,33 @@ | |||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Diagnostics; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| 
 | ||||
| using AspNetCoreMvc.Models; | ||||
| using Ooui; | ||||
| using Ooui.AspNetCore; | ||||
| 
 | ||||
| namespace AspNetCoreMvc.Controllers | ||||
| { | ||||
|     public class SamplesController : Controller | ||||
|     { | ||||
|         public IActionResult Clicker () | ||||
|         { | ||||
|             var count = 0; | ||||
|             var head = new Heading { Text = "Click away!" }; | ||||
|             var label = new Label { Text = "0" }; | ||||
|             var btn = new Button { Text = "Increase" }; | ||||
|             btn.Clicked += (sender, e) => { | ||||
|                 count++; | ||||
|                 label.Text = count.ToString (); | ||||
|             }; | ||||
|             var div = new Div (); | ||||
|             div.AppendChild (head); | ||||
|             div.AppendChild (label); | ||||
|             div.AppendChild (btn); | ||||
|             return new ElementResult (div); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | @ -1,108 +1,29 @@ | |||
| @{ | ||||
|     ViewData["Title"] = "Home Page"; | ||||
|     ViewData["Title"] = "Ooui"; | ||||
| } | ||||
| 
 | ||||
| <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000"> | ||||
|     <ol class="carousel-indicators"> | ||||
|         <li data-target="#myCarousel" data-slide-to="0" class="active"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="1"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="2"></li> | ||||
|         <li data-target="#myCarousel" data-slide-to="3"></li> | ||||
|     </ol> | ||||
|     <div class="carousel-inner" role="listbox"> | ||||
|         <div class="item active"> | ||||
|             <img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Learn how to build ASP.NET apps that can run anywhere. | ||||
|                     <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     There are powerful new features in Visual Studio for building modern web apps. | ||||
|                     <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner3.svg" alt="Package Management" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp. | ||||
|                     <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="item"> | ||||
|             <img src="~/images/banner4.svg" alt="Microsoft Azure" class="img-responsive" /> | ||||
|             <div class="carousel-caption" role="option"> | ||||
|                 <p> | ||||
|                     Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps. | ||||
|                     <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409"> | ||||
|                         Learn More | ||||
|                     </a> | ||||
|                 </p> | ||||
|             </div> | ||||
|         </div> | ||||
| <div class="row" style="margin-top:4em;"> | ||||
|     <div class="col-md-2"> | ||||
|         <img src="images/Icon.png" /> | ||||
|     </div> | ||||
|     <div class="col-md-2"> | ||||
|         <h1>Ooui</h1> | ||||
|         <p>Write interactive web apps in C#</p> | ||||
|     </div> | ||||
|     <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"> | ||||
|         <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> | ||||
|         <span class="sr-only">Previous</span> | ||||
|     </a> | ||||
|     <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"> | ||||
|         <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> | ||||
|         <span class="sr-only">Next</span> | ||||
|     </a> | ||||
| </div> | ||||
| 
 | ||||
| <div class="row"> | ||||
| <div class="row" style="margin-top:4em;"> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Application uses</h2> | ||||
|         <h3>Samples</h3> | ||||
|         <ul> | ||||
|             <li>Sample pages using ASP.NET Core MVC</li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=518004">Bower</a> for managing client-side libraries</li> | ||||
|             <li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li> | ||||
|             <li><a asp-area="" asp-controller="Samples" asp-action="Clicker">HTML Clicker</a></li> | ||||
|             <li><a asp-area="" asp-controller="Samples" asp-action="XamarinFormsClicker">Xamarin Forms Clicker</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>How to</h2> | ||||
|         <h3>Get it</h3> | ||||
|         <ul> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=398600">Add a Controller and View</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699318">Add client packages using Bower.</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Overview</h2> | ||||
|         <ul> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
|     <div class="col-md-3"> | ||||
|         <h2>Run & Deploy</h2> | ||||
|         <ul> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li> | ||||
|             <li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure Web Apps</a></li> | ||||
|             <li><a href="https://github.com/praeclarum/Ooui">Source Code on Github</a></li> | ||||
|         </ul> | ||||
|     </div> | ||||
| </div> | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
|     <title>@ViewData["Title"] - AspNetCoreMvc</title> | ||||
|     <title>@ViewData["Title"] - Ooui</title> | ||||
| 
 | ||||
|     <environment include="Development"> | ||||
|         <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||||
|  | @ -26,7 +26,7 @@ | |||
|                     <span class="icon-bar"></span> | ||||
|                     <span class="icon-bar"></span> | ||||
|                 </button> | ||||
|                 <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">AspNetCoreMvc</a> | ||||
|                 <a asp-area="" asp-controller="Home" asp-action="Index" class="navbar-brand">Ooui</a> | ||||
|             </div> | ||||
|             <div class="navbar-collapse collapse"> | ||||
|                 <ul class="nav navbar-nav"> | ||||
|  | @ -41,7 +41,7 @@ | |||
|         @RenderBody() | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2017 - AspNetCoreMvc</p> | ||||
|             <p>© 2017 - Frank A. Krueger</p> | ||||
|         </footer> | ||||
|     </div> | ||||
| 
 | ||||
|  |  | |||
| Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 5.1 KiB | 
| After Width: | Height: | Size: 5.1 KiB | 
| Before Width: | Height: | Size: 9.5 KiB | 
| Before Width: | Height: | Size: 8.2 KiB | 
| Before Width: | Height: | Size: 11 KiB | 
| Before Width: | Height: | Size: 12 KiB |