AdolphYang

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
protected void Application_BeginRequest(object sender, EventArgs e)
        {
            #region 重写显示章节列表路径
            //http://localhost:19826/Course/CourseController.ashx?action=chapter&courseid=2
            Match match = Regex.Match(Context.Request.Url.ToString(), @"/Course/CourseController_(chapter)(\d+)\.ashx");
            if (match.Success)
            {
                string chapter = match.Groups[1].Value;
                string courseid = match.Groups[2].Value;
                Context.RewritePath("/Course/CourseController.ashx?action=" + chapter + "&courseid=" + courseid);
            } 
            #endregion

        }

 

posted on 2015-09-28 17:52  AdolphYang  阅读(150)  评论(0编辑  收藏  举报