如何从Jquery调用Handler(.ashx)?

ami*_*ard -2 c# asp.net jquery ashx

我有一个HTTP处理程序(.ashx)从数据库生成一些HTML代码,我想从我的Jquery函数调用它并传递一个值(userID).

我不知道如何调用它并检索其数据.

Al *_*l W 7

这样的事情.

$(document).ready(function() {

    $.get("http://path/to/handler.ashx", function(html) {
        alert(html);
    });

});
Run Code Online (Sandbox Code Playgroud)