zoukankan      html  css  js  c++  java
  • 从A页面跳转到B页面动态路由参数

    前台页面

        @using (Ajax.BeginForm("ViewSelectCourseInfo", new RouteValueDictionary { { "id", "" } }, new AjaxOptions { UpdateTargetId = "courselist", InsertionMode = InsertionMode.Replace, OnBegin = "InitLoading", OnSuccess = "responsetable" }, new RouteValueDictionary { { "id", "searchForm" } }))
        {
            <div class="col-lg-8 col-sm-8 col-md-8 col-xs-8">
                <div class="mail-option">     
                    <input type="hidden" id="selectid" name="selectid" value="@ViewBag.selectid" />
                    <div class="btn-group hidden-phone">
                        <input type="text" class="form-control search " id="searchname" name="searchname" placeholder="输入课程名称...">
                    </div>
                    <div class="btn-group hidden-phone">
                        <a class="btn mini tooltips" href="javascript:void(0);" onclick="refresh()" data-placement="right" data-original-title="刷新">
                            <i class=" icon-refresh"></i>
                        </a>
                    </div>
                </div>
            </div>
        }

    后台代码

             [Route("CourseSet/ViewSelectCourseInfo/{selectid}/{id?}")]
            public ActionResult ViewSelectCourseInfo(string selectid,string searchname = "",int id=1)
            {
                if (string.IsNullOrEmpty(selectid))
                {
                    Response.Redirect("/CourseSet/SelectCourseIndex");
                }
                ViewBag.selectid = selectid;
                return AjaxViewCourseInfoPostResult(selectid,searchname, id);
            }  
            private ActionResult AjaxViewCourseInfoPostResult(string selectid="", string searchname = "", int id = 1)
            {
                List<view_course_teacher_info_relation> listCourseInfo = new List<view_course_teacher_info_relation>();
                int totalCount = 0, pageSize =STATICPARAM.DEFAULT_PAGE_SIZE;
                bool isAjax = Request.IsAjaxRequest();
                 if (isAjax)
                {
                   listCourseInfo = ViewCourseTeacherInfoRelationBLL.GetCourseInfoListByConditon(currentUserSchoolId, selectid, "",searchname, id, pageSize, ref totalCount);
                }
                var model = new PagedList<view_course_teacher_info_relation>(listCourseInfo, id, pageSize, totalCount);
                ViewBag.count = totalCount;
                if (isAjax)
                    return PartialView("_LCourseInfoList", model);
                return View(model);
            }  

  • 相关阅读:
    hadoop 2.x 简单实现wordCount
    httpClient连接超时设置
    Java io使用简介
    log4j使用教程
    F#中的自定义隐式转换
    Computation expressions and wrapper types
    Introducing 'bind'
    Understanding continuations
    Computation expressions: Introduction
    MySQL优化总结,百万级数据库优化方案
  • 原文地址:https://www.cnblogs.com/NKing/p/7698036.html
Copyright © 2011-2022 走看看