How can i call DLL function in website runnng on .NET 2
<p>I'm working on this website, trying to call a function from a C# DLL through <code>default.asmx.cs</code></p>

<p>It works fine with .NET version 3.5, but our production site is .NET 2.0</p>

<p>I'm using a simple ajax request to call the method in <code>default.asmx</code> and from there to the DLL. I found that I can not use [WebMethod] in NET2, what could be the other way to work around this?</p>

<pre><code>//this is the Handler
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    [System.Web.Services.WebMethod]
    public static string removeAutoRecharge(string custServiceid)
    {
        Class1 jp = new Class1();
        return jp.removeCustomerAutoRecharge(custServiceid);
    }
}
</code></pre>

<p>//Ajax call:</p>

<pre><code>$.ajax({
    type: "Post",
    url:"default.asnx/removeAutoRecharge",
    data: "{custId:123}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    complete:function (xhr, status)
    {
        alert(xhr.responseText);
        alert(xhr.status);
    },
        success: function(result) 
    {
        $('#AutoMSG').html(result.d);
    },
    error: function(xmlHttpRequest, status, err) 
    {
        $('#AutoMSG').html("error!")
    }
});
</code></pre>
