Sant Roy

Sant Roy

  • 1.6k
  • 122
  • 30k

web method is not working 404 not found

Jan 17 2017 3:13 AM
web method is not working  404 not found 
this  "../ControlAdmin/UploadMultiFile.ashx" method is working but another  "ProductAddEdit.aspx/Test" this one not working  i have tried a lot but still not solved.can anyone help me please???
 
var $a = jQuery.noConflict();
$(document).ready(function () {
$("#fileuploader").uploadFile({
url: "../ControlAdmin/UploadMultiFile.ashx",
fileName: "myfile",
onSuccess: function (files, data, xhr) {
debugger;
$.ajax({
type: "Post",
url: "ProductAddEdit.aspx/Test",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
debugger;
var FileName = '<%=Session["File"] %>';
// var FileName = files;
var imgs = document.getElementById("<%=hdnimages.ClientID %>");
if (imgs.value != null)
imgs.value = imgs.value + '~' + FileName;
else
imgs.value = FileName;
var s1 = "removeimg('" + FileName + "','btn" + FileName + "')";
var addRemove = $("<input type='button' id='btn" + FileName + "' onclick=" + s1 + " value='Remove' class='ajax-file-upload-red'>")
var addimg = $("<img src='../ControlAdmin/ProductImage/ImageThumbnail/" + FileName + "' style='height: 50px;width: 50px;float: none;' />")
var d = document.getElementById('dv1');
var d1 = d.getElementsByClassName("ajax-file-upload-statusbar");
d1[0].style.width = "400px";
var d2 = d.getElementsByClassName("ajax-file-upload-progress");
d2[0].style.display = "none";
addRemove.appendTo(d1[0]);
addimg.appendTo(d1[0]);
},
failure: function(response) {
alert(response.d);
}
});
}
});
});
 
 
this is my web method
 
 
[System.Web.Services.WebMethod()]
public static string Test()
{
return "TEST";
}
i dont know why it is not working.i got error in console 404 method not found,can anyone help me please????????? 
 
 

Answers (4)