zoukankan      html  css  js  c++  java
  • ASP.NET MVC2 in Action 读书笔记 [91] ChildAction

    1). ChildAction

    HomeController.cs:

    [HandleError]
        public class HomeController : Controller
        {
            public ActionResult Index()
            {
                ViewData["Message"] = "Welcome to ASP.NET MVC!";
     
                return View();
            }
     
            [ChildActionOnly]
            public ActionResult ChildAction()
            {
                return View();
            }
        }

    Index.aspx:

    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
        <p>
            To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
        </p>
        <%Html.RenderAction("ChildAction"); %>

    ChildAction.aspx:

    <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
     
    <h2>This view was rendered by calling RenderAction. This is a ChildAction</h2>
     
  • 相关阅读:
    hbase-0.20.6/bin/hbase-daemon.sh: Permission denied
    FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
    微服务:Eureka配置集群环境
    java.net.NoRouteToHostException: No route to host
    原生MapReduce开发样例
    Spring mvc服务端消息推送(SSE技术)
    Spring AOP的实现记录操作日志
    maven多模块项目聚合
    (转载)JAVA中八种基本数据类型的默认值
    mysql性能监控工具
  • 原文地址:https://www.cnblogs.com/RobotTech/p/2123800.html
Copyright © 2011-2022 走看看