zoukankan      html  css  js  c++  java
  • 英文书也没有那么难,跟着例子做,挺有意思的

    控制器

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    
    namespace mvcDemo.Controllers
    {
        public class HomeController : Controller
        {
            public ActionResult Index()
            {
                int hour = DateTime.Now.Hour;
                ViewBag.Greeting = hour < 12 ? "Good Morning" : "Goods Afternoon";
                return View();
            }
    
            public ActionResult About()
            {
                return View();
            }
    
            public ActionResult Contact()
            {
                return View();
            }
        }
    }
    

    视图层

    <!DOCTYPE html>
    @{
        Layout = null;
    }
    
    <html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>首页</title>
        <link rel="stylesheet" href="">
    </head>
    <body>
        <div>@ViewBag.Greeting World!</div>
    </body>
    </html>
    

  • 相关阅读:
    hibernate映射-单向多对一映射
    CSS
    HTML基础
    复习
    元类,单例
    数据类型,约束,存储引擎
    数据库概念,安装,基本操作
    IO模型
    异步回调,协程
    GIL锁,线程池,同步异步
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/6879633.html
Copyright © 2011-2022 走看看