Click here to Skip to main content
15,889,096 members

Comments by matmape (Top 27 by date)

matmape 26-Jul-15 8:30am View    
//<system.web>
// <webservices>
// <protocols>
// <add name="HttpGet">
// <add name="HttpPost">
//</protocols>
//
//
matmape 26-Jul-15 8:30am View    
Hmmm. After staying on this question for 2-3 days now, no answer was given. I found the answer to the question somewhere. I only needed to add this to my web.config file
<system.web>
<webservices>
<protocols>
<add name="HttpGet">
<add name="HttpPost">
</protocols>

matmape 23-Jul-15 9:03am View    
$(document).ready(function () {
var messageLabel = $('#lblResult');
// messageLabel.hide();
$('#btnSaveQuestionNoSetting').click(function () {
//var tlength = $("input:text").length;
var subjIds = new Array();
var qNums = new Array();
var i = 0;
$(".inline :input").each(function () {
var count = $(this).attr('name');
subjIds[i] = count;
qNums[i] = $(this).val();
i++;
});
$.ajax({
url: "../SettingService.asmx/SaveQuestionSetting",
method: 'POST',
data: { subjectIds: JSON.stringify(subjIds), qCount: JSON.stringify(qNums) },
//async: true,
contentType:"application/x-www-form-urlencoded;charset=UTF-8",
success: function (response) {
console.log(response.d);
messageLabel.text("Saved successfully");
var btn = $('#btnSaveQuestionNoSetting');
btn.removeClass("btn-blue");
btn.addClass("btn-success");
btn.val("Saved");
messageLabel.fadeOut(5000);
btn.removeClass("btn-success");
btn.addClass("btn-blue");
},
error: function (errMsg) {
console.log("An error has occured");
console.log(errMsg);
}
});

});
});
matmape 22-Jul-15 9:47am View    
Please, when I added the static keyword to it, it gave me the following error message.
System.InvalidOperationException: SaveQuestionSetting Web Service method name is not valid.
↵ at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
↵ at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
matmape 7-Jul-15 14:33pm View    
Thanks @virusstorm, I really appreciate it. It worked as expected