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>
    

  • 相关阅读:
    uva1220--树的最大独立集+判重
    UVA12186--树型DP
    HDU4171--bfs+树
    远程调用
    高并发业务
    wireshark
    将java程序打包成exe文件
    将博客搬至CSDN
    Mysql分区
    MogileFS
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/6879633.html
Copyright © 2011-2022 走看看