当前位置: 代码迷 >> Ajax >> ajaxpro施用
  详细解决方案

ajaxpro施用

热度:213   发布时间:2012-07-31 12:33:46.0
ajaxpro使用
1:引用ajaxpro2.dll
2:配置
<?xml version="1.0" encoding="utf-8"?>

<!--
  有关如何配置 ASP.NET 应用程序的详细消息,请访问
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpHandlers>
      <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
    </httpHandlers>
  </system.web>
  <connectionStrings>
    <add name="sqlCon" connectionString="server=192.168.18.22;database=TKInfDB;uid=DataCtrl_srv;pwd=1qa2ws3ed"/>
  </connectionStrings>
  <location path="ajaxpro">
    <system.web>
      <httpHandlers>
        <add verb="*" path="*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
      </httpHandlers>
    </system.web>
  </location>
</configuration>
3映射类
public partial class POPClassManagement : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(POPClassManagement));
            if (!Page.IsPostBack)
            {
                showAllPOPClass();

            }
          
        }

4映射方法
[AjaxPro.AjaxMethod]
        public int Add(int num)
        {
            return ++num;
        }


5 前端就可以调用了  (可以不要命名空间)
  相关解决方案