c# - JQuery UI 模态表单对话框将数据保存到数据库

标签 c# javascript jquery

我正在使用JQuery UI Modal Form Dialog 并尝试将旧数据和新数据保存到数据库中。我使用 C#(后端)和 ASP.NET 前端。我可以删除新条目,只是不知道如何保存数据。我尝试过寻找提取 HTML 数据的方法,但无法消除错误。另外不知道是否有更好的方法?这是我的JSFiddle

function addUser() {

我需要找到一种方法来从表中获取数据并将其发布到服务器。

最佳答案

认为您可能正在寻找的是Web方法,它允许jquery(客户端)调用后端(c#)并让它们相互交互。

查看此链接以供引用: http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/

以下是网站的简要摘要:

When it comes to lightweight client-side communication, I’ve noticed that many of you prefer ASP.NET AJAX’s page methods to full ASMX web services. In fact, page methods came up in the very first comment on my article about using jQuery to consume ASMX web services. Given their popularity, I’d like to give them their due attention. As a result of Justin‘s question in those comments, I discovered that you can call page methods via jQuery. In fact, it turns out that you can even do it without involving the ScriptManager at all. In this post, I will clarify exactly what is and isn’t necessary in order to use page methods. Then, I’ll show you how to use jQuery to call a page method without using the ScriptManager.

关于c# - JQuery UI 模态表单对话框将数据保存到数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24745551/

相关文章:

javascript - 我可以得到推荐人吗?

c# - WEB API 启动类异常

c# - 关于异步返回类型

javascript - 如何使图像 slider 进入while循环

javascript - 未捕获的 ReferenceError : require is not defined - Chart. js

javascript - $scope.$watch 在 jquery onchange 之后不触发?

jQuery slideToggle "arrow"改变每个 div

c# - 将嵌套结构编码到 C#

c# - 如何使用后期绑定(bind)从 VB.Net 调用位于 C# DLL 中的方法

Javascript for map 循环