Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > BOOK: Beginning Ajax with ASP.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Ajax with ASP.NET
This is the forum to discuss the Wrox book Beginning Ajax with ASP.NET by Wallace B. McClure, Scott Cate, Paul Glavich, Craig Shoemaker; ISBN: 9780471785446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Ajax with ASP.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 9th, 2006, 02:33 PM
Registered User
 
Join Date: Oct 2006
Location: , , Netherlands.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter7_Onloading.asmx

The sample doesn't work. Onloading is never triggered.

I found a solution at http://groups.google.nl/group/ajaxpr...f2d0759ea64593 , changed the example code accordingly, and now it runs.

Should the code in the book work?
  #2 (permalink)  
Old November 6th, 2006, 04:35 PM
pv pv is offline
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you ever find out why the code in the book did not work?

pv
  #3 (permalink)  
Old November 7th, 2006, 03:10 AM
Registered User
 
Join Date: Oct 2006
Location: , , Netherlands.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works if you change

Code:
<script language="javascript" type="text/javascript">
    Chapter7_OnLoading.onLoading = function(currentVis) {
        var loadingDiv = document.getElementById("loading");
        if(loadingDiv != null) {
            loadingDiv.style.visibility = currentVis ? "visible" : "hidden";
        }
    }
    function ShowLoading(seconds) {
        Chapter7_OnLoading.WaitXSeconds(seconds,WaitXSeconds_Callback);
    }
    function WaitXSeconds_Callback(response) {
        alert(response.value);
    }
</script>
into

Code:
<script language="javascript" type="text/javascript">
    var c=0;
        AjaxPro.onLoading = function(currentVis) {
        c++;
        window.status=c;
        var loadingDiv = document.getElementById("loading");
        if(loadingDiv != null) {
            loadingDiv.style.visibility = currentVis ? "visible" : "hidden";
        }
    }
    function ShowLoading(seconds) {
        Chapter7_OnLoading.WaitXSeconds(seconds,WaitXSeconds_Callback);
    }
    function WaitXSeconds_Callback(response) {
        alert(response.value);
    }
</script>
but I don't completely understand why, apart from the obvious that onloading is not fired in the first part.


  #4 (permalink)  
Old December 4th, 2007, 06:01 PM
Registered User
 
Join Date: Dec 2007
Location: Buenos Aires, Buenos Aires, Argentina.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it's working fine.

The Ajax.onLoading is being executed at the click moment and after
4 seconds have passed.

Var c can be omitted cause it's has not any effect.

Thanks all


El Pascualito
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't execute .asmx files on IIS 5.0 wyury .NET Web Services 1 August 2nd, 2005 06:29 AM
IP From WebService (.asmx) ? cccdotnet .NET Web Services 5 April 6th, 2005 05:14 AM



All times are GMT -4. The time now is 04:17 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.