Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,



XML
alert(document.getElementById('<%=hdnUserId.ClientID %>').value);
        $(".save-job").hide();
        $(".email-to").hide();
        $(".share-link").hide();

        /* Show function*/
        $("#s-job1").click(function () {

            alert(document.getElementById('<%=hdnUserId.ClientID %>').value);
            $("#save-job1").hide();
            $("#email-to1").hide();
            $("#share-link1").hide();
            var dNow = new Date();
            var userid = $('<%=hdnUserId.ClientID %>').val();
            var jobid = $(".head-links > h2").attr("id");
            var saveddate = dNow.getFullYear() + '-' + (dNow.getMonth() + 1) + '-' + dNow.getDate() + ' ' + dNow.getHours() + ':' + dNow.getMinutes();
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "JobResult.aspx/Insert_Data",
                data: "{'userid':'" + userid + "','jobid':'" + jobid + "','savedate':'" + savedate + "'}",
                dataType: "json",
                async: true,
                success: function (response) {
                    $('<%=hdnUserId.ClientID %>').val(''); $(".head-links > h2").attr("id"); dNow.getFullYear() + '-' + (dNow.getMonth() + 1) + '-' + dNow.getDate() + ' ' + dNow.getHours() + ':' + dNow.getMinutes();
                    alert("Record saved successfully..!!");

                },
                 error: function () {

                    alert("Error");

                }
            });


        });
    }

});





ajax function is not calling please tell me cahnges if any modifications
Posted
Updated 27-May-14 22:59pm
v2
Comments
ArunRajendra 28-May-14 4:53am    
Don't see end of ajax call ");". Not sure if you failed to post or its missed.
Member 10226004 28-May-14 4:54am    
alert(document.getElementById('<%=hdnUserId.ClientID %>').value);
$(".save-job").hide();
$(".email-to").hide();
$(".share-link").hide();

/* Show function*/
$("#s-job1").click(function () {

alert(document.getElementById('<%=hdnUserId.ClientID %>').value);
$("#save-job1").hide();
$("#email-to1").hide();
$("#share-link1").hide();
var dNow = new Date();
var userid = $('<%=hdnUserId.ClientID %>').val();
var jobid = $(".head-links > h2").attr("id");
var saveddate = dNow.getFullYear() + '-' + (dNow.getMonth() + 1) + '-' + dNow.getDate() + ' ' + dNow.getHours() + ':' + dNow.getMinutes();
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "JobResult.aspx/Insert_Data",
data: "{'userid':'" + userid + "','jobid':'" + jobid + "','savedate':'" + savedate + "'}",
dataType: "json",
async: true,
success: function (response) {
$('<%=hdnUserId.ClientID %>').val(''); $(".head-links > h2").attr("id"); dNow.getFullYear() + '-' + (dNow.getMonth() + 1) + '-' + dNow.getDate() + ' ' + dNow.getHours() + ':' + dNow.getMinutes();
alert("Record saved successfully..!!");

},
error: function () {

alert("Error");

}
});


});
}

});
Naz_Firdouse 28-May-14 4:57am    
instead of posting it here (as a comment), Use "Improve solution" option and modify your code in the question itself
ArunRajendra 28-May-14 6:31am    
Are you getting the "Error" alert when ajax call is made?
Member 10226004 28-May-14 6:38am    
no error also not displaying,i think it's not calling

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900