MVC3入门试练--控制器-成都快上网建站

MVC3入门试练--控制器

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
    public class StoreController : Controller
    {
        //
        // GET: /Store/

        //public ActionResult Index()
        //{
        //    return View();
        //}

        //控制器操作好像是WEB浏览器直接调用控制器类中的方法。

        //浏览地址:http://localhost:23836/store
        public string Index()
        {
            return "zhangdi";
        }

        //浏览地址:http://localhost:23836/store/Browse?genre=asf
        public string Browse(string genre)
        {
            string str = "genre=" + HttpUtility.HtmlEncode(genre);
            return str;
        }

        //浏览地址:http://localhost:23836/store/details/6
        public string Details(int id)
        {
            return "return details=" + HttpUtility.HtmlEncode(id);
        }

    }
}

MVC3入门试练--控制器

创新互联成立于2013年,我们提供高端网站建设公司成都网站制作网站设计、网站定制、成都全网营销推广小程序制作、微信公众号开发、成都网站营销服务,提供专业营销思路、内容策划、视觉设计、程序开发来完成项目落地,为成都木制凉亭企业提供源源不断的流量和订单咨询。


分享题目:MVC3入门试练--控制器
URL链接:http://kswjz.com/article/ijggoo.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流