Un Template d'Application MVC 4 possède la structure suivante :
|  | 
| ASP.NET MVC 4 : Template | 
|  | 
| ASP.NET MVC 4 : Template Test | 
View
Navigation depuis la vue : 
@Html.ActionLink("Home", "Index", "Home")
System.Web.Mvc.Html.LinkExtensions
        // Summary:
        //     Returns an anchor element (a element) that contains the virtual path of the
        //     specified action.
        // Parameters:
        //   htmlHelper:
        //     The HTML helper instance that this method extends.
        //   linkText:
        //     The inner text of the anchor element.
        //   actionName:
        //     The name of the action.
        //   controllerName:
        //     The name of the controller.
        // Returns:
        //     An anchor element (a element).
        //
        // Exceptions:
        //   System.ArgumentException:
        //     The linkText parameter is null or empty.
        public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName);
Controllers
namespace MvcApplication1.Controllers{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
public abstract class Controller : ControllerBase, IActionFilter, IAuthorizationFilter, IDisposable, IExceptionFilter, IResultFilter, IAsyncController, IController, IAsyncManagerContainer
{
...
namespace System.Web.Mvc
{
public abstract class ActionResult
ViewBag : Objet du controleur de base : dynamic data dictionnary
namespace System.Web.Mvc
{
     public abstract class ControllerBase : IController
    {
         public dynamic ViewBag { get; }
To Be Continued
To Be Continued
Aucun commentaire:
Enregistrer un commentaire
Pour plus d'interactivité, n'hésitez pas à laisser votre commentaire.