This is the onloading demo prepared by ajax.net. Download his Code . If there are several questions:
1. If there is no post-code CS file on An ASPX page, or if no namespace is manually added to vs2005, what is the default namespace of aspx? Is it asp ?? I don't think everyone has noticed this problem. Ask Master Wu banwa to respond immediately. write (this. getType (). tostring () tells me the result. It is indeed ASP;
2. If a class contains Ajax.. Net method. Is there an onloading event for this class when calling this class method from the client? At the beginning of the call, will he return a Boolean value true to this event? After the call ends, a false message is returned to this onloading event?
if my analysis is correct, the author's code will be well understood, and the author's code will be attached later, in the case of An ASPX file, but what should I do if my understanding is incorrect?
3, in the Ajax. Net Google online forum on this matter issued a post, of course, I am using C text, the address is: http://groups.google.com/group/ajaxpro? Lnk = Li, because I am e Wentai food, with the help of translation tools can slightly understand some E text articles , however, I still do not have the ability to post via e-text. I have 10 replies to posts posted on the Google ajax.net Forum, all of which are returned by foreign accounts, I guess I may have been laughed at. Why didn't no Chinese people register for this forum? If you do not have an invitation letter for Gmail, please let me know and I will send it to you !!
the author's onloading. the aspx code is as follows: the author's demo address:
http://www.schwarz-interactive.de/Examples/Special/onloading.aspx
<% @ page Language = "C #" classname = "loadingdemo" inherits = "system. web. UI. page "%>
Private void page_load (Object sender, eventargs E)
{
Ajaxpro. Utility. registertypeforajax (typeof (loadingdemo ));
}
[Ajaxpro. ajaxmethod]
Public datetime longoperation ()
{
System. Threading. thread. Sleep (2000 );
Return datetime. now;
}
</SCRIPT>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<Head>
<Title> Ajax. Net-onloading example </title>
<LINK rel = "stylesheet" type = "text/CSS" href = ".../CSS/main.css"/>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
</Head>
<Body>
<Form ID = "form1" method = "Post" runat = "server"> </form>
<Div class = "content">
<H1> onloading examples
<P> click <a href = "javascript: dotest1 (); void (0);"> here </a> to start a long operating method (2 seconds ). after you have clicked on the link you shoshould see a <I> loading... </I> message in the upper left corner. </P>
</Div>
<Div id = "loadinfo" style = "visibility: hidden; position: absolute; left: 0px; top: 0px; Background-color: red; color: white; "> loading... </div>
<P class = "footer"> last updated: November 2, 2005 by <a href = "http://weblogs.asp.net/mschwarz/contact.aspx" target = "_ blank"> Michael Schwarz </a> </P>
<P> <a href = "http://validator.w3.org/check? Uri = Referer "> </a> </P>
<SCRIPT type = "text/JavaScript" Defer = "Defer">
ASP. loadingdemo. onloading = function (B ){
VaR L = Document. getelementbyid ("loadinfo ");
L. style. Visibility = B? "Visible": "hidden ";
}
Function dotest1 (){
ASP. loadingdemo. longoperation (dotest?callback );
}
Function dotest1_callback (RES ){
Alert (res. value );
}
</SCRIPT>
</Body>
</Html>