The ultimate solution to the problem of AjaxPro is not supported by the server or virtual host

  
                  

The method is: in the website properties --" "Main Directory --" "Configuration --" "Add a map of the .ashx file,

The file path of the mapping is: C: \\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_isapi.dll Extension:

.ashx Action: GET, HEAD, POST, DEBUG

Check if the file exists or not. Br>

First add the following

<httpHandlers> <add verb="POST,GET" path="AjaxPro in the <system.web> of Web.config /*.ashx" type="AjaxPro.AjaxHandlerFactory, axPro" />

or (see version)

<add verb="POST,GET" path=" Ajaxpro/*.ashx" pe="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>

</httpHandlers>

Then add the following line of code in the server-side Page_Load AjaxPro. Utility.RegisterTypeForAjax(typeof(index));

The following is how to use the javascript to call the server-side method on the client side. The server-side method returns a DataSet

[AjaxPro.Aj axMethod] public DataSet Change() { string str="select xjh,xm from xs_jbxx"; ds=cla.Bind(str); return ds; }

Then call this method on the client

<script language="javascript"> function Change() { WebServer.index.Change(change_callback) } function change_callback(response) { var ds=response.value; var content=document.getElementById(" newDG"); var table=null; for(var i=0;i<ds.Tables[0].Rows.length;i++) { if(i==0) { table=ds.Tables[0].Rows [i].xm+"<br>"; } else { table+=ds.Tables[0].Rows[i].xm+"<br>"; } } content.innerHTML=table ; } </script>

Copyright © Windows knowledge All Rights Reserved