Click here to Skip to main content
16,011,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
actually i used to retrive the data from server on scroll..
i used the below ajax code


JavaScript
// JScript File
 
$(document).ready(function () {
    $contentLoadTriggered = false;
    $("#mainDiv").scroll(function () {
        if ($("#mainDiv").scrollTop() >= ($("#wrapperDiv").height() - $("#mainDiv").height()) && $contentLoadTriggered == false) 
        {
            $contentLoadTriggered = true;
            $.ajax(
            {
                type: "POST",
                url: "LoadOnScroll.aspx/GetDataFromServer",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async: true,
                cache: false,
                success: function (msg) {
                $("#wrapperDiv").append(msg.d);
                $contentLoadTriggered = false;
                },
                error: function (x, e) {
                alert("The call to the server side failed. " + x.responseText);
                }
            });
        }
    });
});


if we use the above code in the html form $("#wrapperDiv").append(msg.d); is working fine
if the same code is executing in content placeholder inside a master page $("#wrapperDiv").append(msg.d); is not working .....

i used to print the argument msg.d for both the cases msg.d is the same

Please help me .
Posted
v3

1 solution

I guess you should try with the ClientID of the div.

Try like below...
JavaScript
$('#' + '<%= wrapperDiv.ClientID %>').append(msg.d);
 
Share this answer
 
v2
Comments
sagar.panuganti 7-Aug-13 0:38am    
Thanks for ur response ....
i tried by using clientID but still not working.
Do you see any errors in console tab of FireBug in FireFox?
sagar.panuganti 7-Aug-13 3:32am    
i have executed the code in fire bug
no errors..
no warnings..
and return correct message from the server
but in ALL->post ->There are no child objects


only it shows the above message
Please check the ID of that div in html source, which is rendered in browser.

And what is ...

but in ALL->post ->There are no child objects

I can't understand.
sagar.panuganti 7-Aug-13 4:37am    
in firebug it shows as

There are no child objects

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900