15.1.1 Creating the Example Controller; Listing 15-3 The Contents of the AdminController.cs File
This commit is contained in:
parent
67c6858c48
commit
afb82add7b
19
UrlsAndRoutes/UrlsAndRoutes/Controllers/AdminController.cs
Normal file
19
UrlsAndRoutes/UrlsAndRoutes/Controllers/AdminController.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace UrlsAndRoutes.Controllers
|
||||
{
|
||||
public class AdminController : Controller
|
||||
{
|
||||
// GET: Admin
|
||||
public ActionResult Index()
|
||||
{
|
||||
ViewBag.Controller = "Admin";
|
||||
ViewBag.Action = "Index";
|
||||
return View("ActionName");
|
||||
}
|
||||
}
|
||||
}
|
@ -93,6 +93,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\RouteConfig.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
@ -112,6 +113,7 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Views\Admin\" />
|
||||
<Folder Include="Views\Home\" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
|
Loading…
x
Reference in New Issue
Block a user