单击linkBut​​ton显示模态

时间:2015-02-16 11:16:25

标签: javascript asp.net modal-dialog

              

$(document).on("click", "[id*=lnkView]", function () {

    $("#resultId").html($(".ResultId", $(this).closest("tr")).html());
    **//$("#name").html($(".Name", $(this).closest("tr")).html());
                //$("#description").html($(".Description",$(this).closest("tr")).html());**

          $("#dialog").dialog({
              title: "Analyze Result",
              buttons: {
                        Ok: function () {
                            $(this).dialog('close');
                        }
              },
              modal: true
           });
           return false;
           });
</script>

这是我的剧本。

如何将其链接到数据库?

我是javascript的新手。

1 个答案:

答案 0 :(得分:0)

为了将数据链接到数据库,你需要一些中间层,可能是ASP.NET Web API,ASP.NET MVC或任何其他可以返回Json的MVC模式应用程序。

您可以使用JQuery $ .ajax()函数在Web应用程序中点击Action的URL并简单地使用它。

这些是几个资源,您应该从以下开始: http://www.sitepoint.com/use-jquerys-ajax-function/

jQuery: Return data after ajax call success

相关问题