How to Use magicajax
Magicajax introduction and how to configure magicajax (. NET Framework 1.1)
In the hot days of Web2.0, Ajax became a trend. The basic concept here is no longer detailed here, you can learn some information from http://news.csdn.net/n/20051027/28202.html.
Magicajax is an Ajax solution for. NET 1.1 and 2.0. You can http://prdownloads.sourceforge.net/magicajax/magicajax-0.3.0-source.zip at the place? Download to it. The launch form is a webcontrol. You can add this DLL in your vs. Net toolbox, and then drag it out and use it like a common control.
Currently, most people use. NET Framework 1.1.
To correctly use the magicajax control, perform the following steps:
1. Copy the magicajax DLL to the bin of your main project.
2. Add the DLL in the toolbox of vs. net.
3. The magicajax compressed package contains two JS script files, ajaxcallobject. js and webparts. js. The former is the client responsible for magicajax's general transactions, and the latter is a script specifically for webparts. Copy both of them to your main JS directory. Taking my solution as an example, I copied the two to the script folder under the root directory of the site for storage.
4. Modifying web. config many people have asked this question in the magicajax forum. In fact, there are some problems in the bekas example.
The correct configuration should be as follows:
First, create the following tag in <configsections> </configsections> of Web. config:
<Section name = "magicajax" type = "magicajax. configuration. magicajaxsectionhandler, magicajax"/>
If your web. config does not contain <configsections> </configsections>
Copy the following parts and make sure they are stored in <configuration> </configruation>.
<! --*************************************** * ********** -->
<Configsections>
<Section name = "magicajax"
Type = "magicajax. configuration. magicajaxsectionhandler, magicajax"/>
</Configsections>
<! --*************************************** * ********** -->
Next, create the following content in the <Configure> </Configure> label:
<Magicajax scriptpath = "~ /Script "outputcomparemode =" hashcode "tracing =" false ">
<Pagestore
Mode = "nostore"
Unloadstoredpage = "false"
Cachetimeout = "5"
Maxconcurrentpages = "5"
Maxpageslimitalert = "true"
/>
</Magicajax>
The parameters are described as follows:
/*************************************** ******************/
Magicajax
I. scriptpath: The storage path of the two scripts we just mentioned. When setting this parameter ~ /, That is, the root directory of the site as a starting point. For example, if you want to set the magicajax JS script to the script in the blog under the root directory of the site, write it ~ /Blog/script. In other cases, you can make your own reasoning ~
2. Compare modes for outputcomparemode Script output: fullhtml, hashcode, and MD5
Hashcode. The details are described in the following sections.
Iii. Tracing: whether to trace if it is set to true. An alert will pop up each time the Ajax request is responded to display the specific script to be loaded.
Debugging only
/*************************************** ******************/
Pagestore is used to configure the cache tag of Ajax JS scripts
I. Mode Page Object Storage modes include nostore, session, and cache.
Nostore, the page object will not be cached
Session, the page object will be stored in the session of the site
Cache, the page object is stored in the cache of the site.
2. Whether the unloadstoredpage clears the cache or session of the created page object in the page's unload object. Generally, this parameter is set to false.
3. The expiration time of cachetimeout cache is measured in minutes.
4. maxconcurrentpages the number of page objects that can be cached on the same page is generally 5
5. Whether maxpageslimitalert warns of reaching the maximum number of caches is generally false.
Why cache page objects?
/*************************************** ******************/
In the last step
<Httpmodules>
<Add name = "magicajax" type = "magicajax. magicajaxmodule, magicajax"/>
If <system. Web> </system. Web> does not contain
Copy the following tags to your <system. Web> </system. Web>.
<Httpmodules>
<Add name = "magicajax" type = "magicajax. magicajaxmodule, magicajax"/>
</Httpmodules>
The above is the configuration step.