Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 9th, 2006, 02:33 PM
Registered User
 
Join Date: Oct 2006
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?
 
Old November 6th, 2006, 04:35 PM
pv pv is offline
Registered User
 
Join Date: Nov 2006
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
 
Old November 7th, 2006, 03:10 AM
Registered User
 
Join Date: Oct 2006
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.


 
Old December 4th, 2007, 06:01 PM
Registered User
 
Join Date: Dec 2007
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.