我试图调用我的自定义Htpp处理程序,并希望传递一些参数但我无法在http处理程序进程请求方法中检索这些param的值.
我用的代码就像..
我用的代码就像..
在客户端
$.ajax({ url: 'VideoViewValidation.ashx',type: 'POST',data: { 'Id': '10000','Type': 'Employee' },contentType: 'application/json;charset=utf-8',success: function (data) { debugger; alert('Server Method is called successfully.' + data.d); },error: function (errorText) { debugger; alert('Server Method is not called due to ' + errorText); } });
这是我的自定义http Handler
public class VideoViewValidation : IHttpHandler { public void ProcessRequest(HttpContext context) { string videoID = string.Empty; string id = context.Request["Id"]; string type = context.Request["Type"]; } }
请告诉我问题出在哪里.