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>
     
  • 相关阅读:
    通过网格拆分高德地图
    vue-router重定向 不刷新问题
    vue-scroller记录滚动位置
    鼠标滚轮更改transform的值(vue-scroller在PC端的上下滑动)
    position sticky的兼容
    js截图及绕过服务器图片保存至本地(html2canvas)
    禁止页面回退到某个页面(如避免登录成功的用户返回到登录页)
    手动创建script解决跨域问题(jsonp从入门到放弃)
    逻辑回归的常见面试点总结
    听说你不会调参?TextCNN的优化经验Tricks汇总
  • 原文地址:https://www.cnblogs.com/RobotTech/p/2123800.html
Copyright © 2011-2022 走看看