从html c#数据表行中获取值并将其发布到iframe外部

大家好,我正在使用asp.net mvc环境开发一个小型网站,如果我在iframe上渲染数据表,则该数据表会从其所在视图(iframe)上的formcollection接收参数,因此每次提交时都会刷新帖子。

无论如何,在最后一列的表格中显示的每个ROW上都有一个

                    <div class="row">
                        <!-- Table -->
                        <div class="card-body">
                            <div class="table-striped">
                                <table class="table table-bordered" width="100%" cellspacing="0">
                                    <thead align="center">
                                        <tr>
                                            <th>No.</th>
                                            <th>ID</th>
                                            <th>Pick</th>
                                        </tr>
                                    </thead>
                                    <tbody id="mydataTable">
                                        @{
                                            foreach (System.Data.DataRow dr in dt_ICCSSC.Rows)
                                            {
                                                string num_operacion = dr["num-op"].ToString();
                                                string cust_id = dr["id"].ToString();
                                                string name = dr["name"].ToString();

                                                <tr>
                                                    <td align="center">@num_op</td>
                                                    <td>@cust_id - @name</td>
                                                    @using (html.beginform("MyView","MyController",FormMethod.Post,new { target = "_top" }))
                                                    {
                                                    <td align="center">
                                                        <button type="submit" class="btn btn-info">Pick</button>
                                                    </td>
                                                    }
                                                </tr>

                                            }
                                        }
                                    </tbody>
                                </table>
                            </div>


                        </div>

                    </div>

此数据表来自

    @model Project.Models.MyModels
    @{
        System.Data.DataSet ds_IIICCC = Model.cargar();
        System.Data.DataTable dt_ICCSSCX = ds_IIICCC.Tables[2];
        System.Data.DataTable dt_dt_ICCSSC = ds_IIICCC.Tables[1];
     }

那么我如何在用剃刀语法创建的表的td的td内抓住tr?

zzzz1287 回答:从html c#数据表行中获取值并将其发布到iframe外部

您可以尝试如下操作: https://dotnetfiddle.net/GJRsag

本文链接:https://www.f2er.com/3143329.html

大家都在问