【问题标题】:Passing values from button click event to jquery将值从按钮单击事件传递给 jquery
【发布时间】:2013-07-15 07:16:58
【问题描述】:

我在按钮点击事件后面有以下代码:

 protected void buttonAccept_Click(object sender, EventArgs e)
 {
      string dataTable;
      DataTable tbl1 = GridView1.DataSource as DataTable;     
 }

我需要同时使用 #buttonAccept 中的 dataTable 和 tbl1

 $("#buttonAccept").ajaxSubmit(
                  "./test/writeToDb"
                  , function (response) {
                      Info(
                         "DataSaved."     
                         }
                      );

任何想法如何实现这一目标?

【问题讨论】:

    标签: c# jquery .net


    【解决方案1】:

    var gvTable = $('#GridView1').dataTable();

    我认为这将为您提供要访问的数据表。

    至于dataTable字符串。你可以使用隐藏字段,在 Click 方法中填充它,然后在 ajaxSubmit 客户端事件中引用它吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-27
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 2016-10-02
      • 2012-02-19
      • 1970-01-01
      相关资源
      最近更新 更多