【问题标题】:how to pass grid view data to the other view as per selected id如何根据选定的 ID 将网格视图数据传递给另一个视图
【发布时间】:2015-08-17 07:07:17
【问题描述】:
//this is my web grid

using (Html.BeginForm())
{
    <div id="content">
        @grid.GetHtml(
          tableStyle: "webgrid-table",
          headerStyle: "webgrid-header",
          footerStyle: "webgrid-footer",//properties
          alternatingRowStyle: "webgrid-alternating-row",//this are the 
          rowStyle: "webgrid-row-style",
          columns: grid.Columns(
              grid.Column(header: "job_id", format: @<text><div>@(item.WebGrid.Rows.IndexOf(item) + 1)</div></text>),
              grid.Column(columnName: "location", header: "location"),
              grid.Column(columnName: "jobtitle", header: "jobtitle"),
              grid.Column(columnName: "technology", header: "technology"),
              grid.Column(columnName: "job_description", header: "job_description"),
              grid.Column(columnName: "category", header: "category"),
              //this is link for navigating to next page with selected id                                                 
              grid.Column(columnName: "Apply",format:@<text>@Html.ActionLink("Apply", "JobDetails", "Client")</text>)
         ))
    </div>
}

【问题讨论】:

    标签: asp.net-mvc-3 asp.net-mvc-4 webgrid


    【解决方案1】:

    如果我正确理解了您的问题,那么这可能会有所帮助:

    将网格组件提取到局部视图,然后可以在任何地方重复使用。

    如果您的意思是仅提取数据,那么您必须使用 jQuery ajax 来提取感兴趣的数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-11
      • 2021-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多