1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2025-06-07 16:06:21 +00:00
2017-04-11 00:16:00 +09:00

26 lines
608 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace UrlsAndRoutes.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Controller = "Home";
ViewBag.Action = "Index";
return View("ActionName");
}
public ActionResult CustomVariable(string id = "DefaultId")
{
ViewBag.Controller = "Home";
ViewBag.Action = "CustomVariable";
ViewBag.CustomVariable = id; // ?? "<no value>"; // id; // RouteData.Values["id"];
return View();
}
}
}