成都创新互联网站制作重庆分公司

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入门试练--控制器
浏览地址:http://cxhlcq.com/article/ijggoo.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部