zoukankan      html  css  js  c++  java
  • AJAX enabled & disabled

    @model string
               
    @{
        ViewBag.Title = "GetPeople";
        AjaxOptions ajaxOpts = new AjaxOptions { UpdateTargetId = "tableBody", InsertionMode= InsertionMode.Replace,
                                                 Url = Url.Action("GetPeopleData") //确保javascript enable和disable时能正常显示
        };
    }
    <h2>
        GetPeople</h2>
    <table>
        <thead>
            <tr>
                <th>
                    First
                </th>
                <th>
                    Last
                </th>
                <th>
                    Role
                </th>
            </tr>
        </thead>
        <tbody id = "tableBody">
           @Html.Action("GetPeopleData", new { selectedRole = Model })
        </tbody>
    </table>

    @using(Ajax.BeginForm(ajaxOpts))
    {
        <div>
            @Html.DropDownList("selectedRole", new SelectList(
    new[] { "All" }.Concat(Enum.GetNames(typeof(Role)))))
            <button type="submit">
                Submit</button>
        </div>
    }

    <div>
        @foreach (string role in Enum.GetNames(typeof(Role)))
        {
            <div class="ajaxLink">
                @Ajax.ActionLink(role, "GetPeople",
          new { selectedRole = role },
          new AjaxOptions
          {
              UpdateTargetId = "tableBody",
              Url = Url.Action("GetPeopleData", new { selectedRole = role })
          })
            </div>
        }
    </div>

  • 相关阅读:
    偏振光相机2
    偏振光相机1
    偏振光工业相机
    Qt QSlider介绍(属性设置、信号、实现滑块移动到鼠标点击位置)
    C++ malloc()和free()函数的理解
    C++调用MATLAB函数
    C/C++ 获取unsigned short的高八位和低八位数值
    Qt QtConcurrent::Run 阻塞方式调用
    Qt QtConcurrent::Run 非阻塞方式调用
    Cognex.VisionPro.QuickBuild命名空间下的一些委托方法
  • 原文地址:https://www.cnblogs.com/wzh206/p/3165804.html
Copyright © 2011-2022 走看看