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>
     
  • 相关阅读:
    mysql 查询本年当前季度数据
    eclipse导入项目出现红叉怎么办
    input框只能输入正数
    解压MAC压缩的zip文件
    文件上传,文件下载,解压zip文件,判断压缩文件里面包含几个文件,判断压缩文件里是否包含指定的后缀文件
    解决IE下readonly的Input光标选中的问题
    前端JS下载文件总结
    Angular变更检测策略报错
    笛卡尔算法
    Angualr 内置工具-SelectionModel
  • 原文地址:https://www.cnblogs.com/RobotTech/p/2123800.html
Copyright © 2011-2022 走看看