【问题标题】:Best way to implement save field in DataGrid when user tabs out or field looses focus当用户选项卡退出或字段失去焦点时,在 DataGrid 中实现保存字段的最佳方法
【发布时间】:2010-10-03 03:18:17
【问题描述】:

我有一个带有 .Net 网格视图的页面,每行大约有 12 个文本字段,大约有 250 行。现在在页面底部有一个全部保存按钮,它将所有字段 12x250 发送到服务器,然后将它们逐个输入到 db 1 中。最终会非常缓慢,有时根本无法通过。我没有想出这个,但最终得到了一个人的角色来改进它。我认为在这种情况下最好的方法是在失去焦点时保存该字段。使用 gridview 在 .Net 中实现此功能的最佳方法是什么?

页面上已经加载了 jquery 库。当前页面上没有实现 ajax。

【问题讨论】:

    标签: .net jquery ajax gridview user-interface


    【解决方案1】:

    如果你有JQUERY,你可以调用一个“页面方法”阅读这个post,一定要检查cmets我不确定他是否更新了他的文章:-)

    编辑

    此外,您还可以调用 Web 服务,这是我的代码示例,显示我调用 WCF 服务:

    $.ajax({
      type: "POST",
      url: "../Services/Utilities.svc/IsPrintDownloadDone",
      data: "{}", //This should be a JSON representation of yoru inputs that the WCF can serialize into objects
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(msg) {//msg.d has the response from server
            },  
      error: function (xhr, textStatus, errorThrown) {
    
    }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-23
      • 2011-08-19
      • 1970-01-01
      • 1970-01-01
      • 2011-10-13
      相关资源
      最近更新 更多