PageMethods not calling method

286 views Asked by At

I have setup a page so that when a link is clicked it calls a JavaScript function which calls a Page Method. This works perfectly on our development and staging sites but does not work on our live site. There is no error being generated, it just doesn't call the method. I do have the script manager tag on the page and "EnablePageMethods" is set to true. Does anyone have any ideas. Thank you in advance for any help that maybe offered.

<script type='text/javascript'>
    function RequestAQuote_Click(ctti) {
        PageMethods.RecordClickThrough(ctti);
    }
</script>


[WebMethod]
public static void RecordClickThrough(int clickThroughTrackedId)
{
    try
    {
        using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["globalair"].ToString()))
        {
            connection.Open();
            using (SqlCommand command = new SqlCommand("seo.spRecordClickThroughs", connection))
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@ClickThroughsTrackedId", clickThroughTrackedId);
                command.ExecuteNonQuery();
            }
        }
    }
    catch(Exception ex)
    {
        ErrorLog(ex.ToString(), "RecordClickThrough");
    }
}
0

There are 0 answers