I am trying to call the .net method from a JavaScript file in a Web Form project, I am unsure if I am doing things correctly and I am struggling to debug.

.net method:

```
    [System.Web.Services.WebMethod]
    public static void UpdateDatabase(string location, string content)
    {
        string connectionString = @"Server=DESKTOP-JFCN2O9\SQLEXPRESS;Database=Opticron;User Id=website;Password=Popcorn99!";
        SqlConnection connection = new SqlConnection(connectionString);
        connection.Open();
        SqlCommand command = new SqlCommand("UPDATE [dbo].[Content] SET [ContentData] = " + content + "WHERE [ContentLoc] = " + location);

        command.CommandType = System.Data.CommandType.Text;
        command.Connection = connection;

        command.ExecuteNonQuery();
        connection.Close();

    }

```

JavaScript file:

```
$(document).ready(function ($) {

$('.editBtn').click(function () {
    $(this).closest("tr").find(".contentInput").removeAttr('readOnly');
    $(this).closest("td").find(".saveBtn").removeAttr('hidden');

})

$('.saveBtn').click(function () {
    var changedContent = $(this).closest("tr").find(".contentInput").val();
    var locOfChange = $(this).closest("tr").find(".loc").text();

    $.ajax({
        url: '../../WebForm1.aspx/UpdateDatabase',
        method: 'post',
        contentType: 'application/json',
        data: '{location:' + locOfChange + ', content:' + changedContent + '}',
        dataType: 'json',
        success: function () {
            alert("success")
        },
        error: function (error) {
            alert(error)
        }
    })

    $(this).closest("tr").find(".contentInput").attr('readonly')
    $(this).closest("td").find(".saveBtn").attr('hidden');
})

```

});

I am expecting the database to be updated and the web page to be adjusted as expected... there shouldn't be any issue with the database as i am using a select function in the load of the page and that works correctly.

Addon info : Errors :
when i load the page everything loads up but i get this error - 
Failed to load resource: the server responded with a status of 404 ()

when i click on the saveBtn i get this error - 
jquery.js:9600 POST <https://localhost:44341/WebForm1.aspx/UpdateDatabase> 500