0

$(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>

This is my script.

How do I link it to the database ?

I am completely new to javascript.

TRY123
  • 19
  • 1
  • 7

1 Answers1

0

For linking data to Database you need some middle layer in between, which could be ASP.NET Web API, ASP.NET MVC or any other PHP with MVC pattern application which could return Json.

You can utilize JQuery $.ajax() function to hit the URL to your Action in your Web application and consume it simply.

These are couple of resources, you should start with: http://www.sitepoint.com/use-jquerys-ajax-function/

jQuery: Return data after ajax call success

Community
  • 1
  • 1
Nabeel
  • 73
  • 9
  • Actually I just need a modal that has to update information in a database.All this is required or there is a simpler way ? – TRY123 Feb 17 '15 at 04:26
  • You can't directly access Database from internet browser. So your browser should must hit back with Server having Server side application like mentioned earlier, which is linked with Database, will then process the request and update information in the database and then send response. – Nabeel Feb 18 '15 at 07:14