• 从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);
            }  

  • 相关阅读:
    pycharm pip 源修改以及包管理(转载)
    zabbix在执行docker命令是报错
    ubuntu 14.04zabbix的安装
    docker搭建zabbix
    docker的安装
    docker registry v2与harbor的搭建
    docker常用命令
    centos安装桌面,下面的几个包缺一不可
    MSSQL数据库高版本迁移到低版本
    .NET开源MSSQL、Redis监控产品Opserver之Exception配置
  • 原文地址:https://www.cnblogs.com/NKing/p/7698036.html
Copyright © 2020-2023  润新知