magicajax的使用說明 1 (ajax,ajaxpro,magicajax)

來源:互聯網
上載者:User
 1、開啟vs 添加 MagicAjax.dll,就會有AjaxPanel 控制項,就往上拖東西吧。(簡單吧!)
    2、開啟web.config 添加:

          <configSections>
             <section name="magicAjax" type="MagicAjax.Configuration.MagicAjaxSectionHandler, MagicAjax"/>
          </configSections>

              <system.web>
                 ...
                    <httpModules>
                           <add name="MagicAjaxModule" type="MagicAjax.MagicAjaxModule, MagicAjax"/>
                   </httpModules>
                ...
             </system.web>

         以上兩步就可以實現Ajax了,是不是很簡單。如果你覺得loading....很難看,接著來。

3、首先,下載magicAjax源碼,拷貝script目錄到你的目錄裡。

4、 開啟web.config 添加:

             <magicAjax tracing="false" scriptPath="~/script">
              <pageStore/>
             </magicAjax>

5、 開啟script目錄,編輯AjaxCallObject.js(在最後)找到並改成下面的,
             .....
                    function CreateWaitElement() {
                        var elem = document.getElementById('__AjaxCall_Wait');
                     if (!elem) {
                               elem = document.createElement("div");
                               elem.id = '__AjaxCall_Wait';
                               elem.style.position = 'absolute';
                               elem.style.height = 17;
                               elem.border = "1px";
                               elem.style.paddingLeft = "3px";
                               elem.style.paddingRight = "3px";
                               elem.style.fontSize = "12px";
                               elem.style.borderColor = "#990000";
                               elem.style.borderWidth = "0";
                               elem.style.borderStyle="solid";
                               elem.style.backgroundColor = "#990000";
                               elem.style.color = "#FFFFFF";
                               elem.innerHTML = "正在載入...";
                               elem.style.visibility = 'hidden';

                          document.body.insertBefore(elem, document.body.firstChild);     
                  }
                       waitElement = elem;    
                     }
                      // end wait element
       
             試一下 ,看看效果,怎麼出現亂碼?別急,接著改。

6、 開啟web.config 改
         第一:<?xml version="1.0" encoding="gb2312" ?>
         第二:添加
                        <globalization
                                 requestEncoding="gb2312"
                                  responseEncoding="gb2312"
                             />

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.