Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added controller path formats and areas into arrays Added Area 'Foo' to the RequireJsNet.Examples project Aligned controller / view / entrypoint names with the respective layout names (FooBar -> Entrypoint) Updated the entrypoint js files to alert their path (except complexLoad)
- Loading branch information
Showing
14 changed files
with
155 additions
and
46 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
RequireJsNet.Examples/App/Controllers/Root/Home/EntryPoint.js
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,3 @@ | ||
require([], function() { | ||
alert("home/entrypoint"); | ||
}); |
This file was deleted.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
RequireJsNet.Examples/Areas/Foo/Controllers/HomeController.cs
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 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.Mvc; | ||
using RequireJsNet.Examples.Controllers; | ||
|
||
namespace RequireJsNet.Examples.Areas.Foo.Controllers | ||
{ | ||
public class HomeController : BaseController | ||
{ | ||
public ActionResult Index() | ||
{ | ||
return View(); | ||
} | ||
} | ||
} |
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,25 @@ | ||
using System.Web.Mvc; | ||
|
||
namespace RequireJsNet.Examples.Areas.FooBar | ||
{ | ||
public class FooAreaRegistration : AreaRegistration | ||
{ | ||
public override string AreaName | ||
{ | ||
get | ||
{ | ||
return "Foo"; | ||
} | ||
} | ||
|
||
public override void RegisterArea(AreaRegistrationContext context) | ||
{ | ||
context.MapRoute( | ||
"Foo_default", | ||
"Foo/{controller}/{action}/{id}", | ||
new { controller="Home", action = "Index", id = UrlParameter.Optional }, | ||
namespaces: new string[] { "RequireJsNet.Examples.Areas.Foo.Controllers" } | ||
); | ||
} | ||
} | ||
} |
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,32 @@ | ||
@{ | ||
ViewBag.Title = "Home Page"; | ||
Layout = "~\\Views\\Shared\\_LayoutSimple.cshtml"; | ||
} | ||
|
||
<div class="jumbotron"> | ||
<h1>ASP.NET</h1> | ||
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p> | ||
<p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more »</a></p> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-4"> | ||
<h2>Getting started</h2> | ||
<p> | ||
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that | ||
enables a clean separation of concerns and gives you full control over markup | ||
for enjoyable, agile development. | ||
</p> | ||
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more »</a></p> | ||
</div> | ||
<div class="col-md-4"> | ||
<h2>Get more libraries</h2> | ||
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p> | ||
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more »</a></p> | ||
</div> | ||
<div class="col-md-4"> | ||
<h2>Web Hosting</h2> | ||
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p> | ||
<p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more »</a></p> | ||
</div> | ||
</div> |
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,36 @@ | ||
<?xml version="1.0"?> | ||
|
||
<configuration> | ||
<configSections> | ||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> | ||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | ||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
|
||
<system.web.webPages.razor> | ||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> | ||
<pages pageBaseType="System.Web.Mvc.WebViewPage"> | ||
<namespaces> | ||
<add namespace="System.Web.Mvc" /> | ||
<add namespace="System.Web.Mvc.Ajax" /> | ||
<add namespace="System.Web.Mvc.Html" /> | ||
<add namespace="System.Web.Routing" /> | ||
<add namespace="System.Web.Optimization" /> | ||
<add namespace="RequireJsNet.Examples" /> | ||
|
||
</namespaces> | ||
</pages> | ||
</system.web.webPages.razor> | ||
|
||
<appSettings> | ||
<add key="webpages:Enabled" value="false" /> | ||
</appSettings> | ||
|
||
<system.webServer> | ||
<handlers> | ||
<remove name="BlockViewHandler"/> | ||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> | ||
</handlers> | ||
</system.webServer> | ||
</configuration> |
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,3 @@ | ||
require(['jquery', 'domReady'], function() { | ||
alert("foo/home/index"); | ||
}); |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
require([], function() { | ||
|
||
alert("home/basic"); | ||
}); |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
require(['jquery', 'domReady'], function() { | ||
console.log("home/index loaded"); | ||
alert("home/index"); | ||
}); |
File renamed without changes.
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