Anthem. NET is really a good thing. It is not only open-source but also easy to use, and can easily create various Ajax applications.
A small amount of code is required. First, write the logic in the control's server event, and then add the Control ID. updateaftercallback = true; to automatically call back and update the control. The autocallback attribute is also provided for controls with the autopostback attribute. With these two attributes, the control has no refresh update and data transmission functions.
Anthem. Net also provides the anthem. Manager. addscriptforclientsideeval () method, which can execute JavaScript Functions on the server anytime and anywhere. This method has a huge role.
With the powerful tool, it is easy to wait for the page without refreshing.
Add a loading image or table on the front-end page <Div id = "pnlajaxload" style = "display: none">
<Div id = "msg1"> <font face = "verdana, Arial, helvetica "color =" # ea9b02 "size =" 2 "> <B> loading </B> </font> </div>
</Div>
Then write the function to show and hide loading entries in the Javascript file. The page must contain this file. Function hideajaxloading () // hide the form
{
Document. getelementbyid ("pnlajaxload"). style. Display = 'none ';
}
Function showajaxloading () // display form
{
VaR ELEM = Document. getelementbyid ("pnlajaxload ");
If (ELEM)
{
ELEM. style. Display = 'block ';
ELEM. style. Visibility = 'visable ';
}}
Finally, add the following code to the event, which can be a pageload event, a button click event, or an index changed event based on different project requirements. Btnlast. Attributes. Add ("onclick", "showajaxloading ();");
Dropchangepage. Attributes. Add ("onchange", "showajaxloading ();");
// Note that you must add the JS function that is executed when the control event is triggered.
Public void pagerbuttonclick (Object sender, eventargs E)
{
// Logic processing code
Anthem. Manager. addscriptforclientsideeval ("hideajaxloading ();");
}
Here we are all done, and the results are perfect cheers!
There are also some problems related to the use of anthem. net. Because they are all js-based operations, many methods on the server end cannot work, such as the common response. Write. If global variables are declared on the page, the global variables are assigned the default value during callback, resulting in data loss. However, controls on the page can save their own information through viewstates.
Anthem. net also provides additional practical controls such as autosuggesttextbox, editlabel, progressbar, calendar, yuiautocomplete, etc. In order to make it easier for developers to use, it also provides a lot of instance code and Online Demo, this is very valuable and can be quickly used by beginners and experienced developers.
In short, using anthem. Net for Ajax development is a wise choice ~
Site: http://anthem-dot-net.sourceforge.net/http://www.cnblogs.com/RChen/category/69922.htmlCreated by jecray