Click here to Skip to main content
16,007,277 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello everyone,
Please I need help.

For three days now that I'm searching for a good solution without any success :(

I have a website solution includes two pages.
One aspx page is used for sending xmlhttprequests and another aspx page is used for getting the requests and return the responses.
* I'm sending the requests in sync mode

For exapmle:

C#
function ExpandAll() {
    var treeviewCell = document.getElementById('cell_treeview');
    var treeview = treeviewCell.childNodes[0];
    if (treeview != null) {
        for (var r = 0; r < treeview.rows.length; r++) {
            var nodeID = treeview.rows[r].id.split('_')[1];
            ExpandBranch(nodeID);
        }
    }
}


C#
function ExpandBranch(nodeID) {
           var data = "<Node Action=\"GetBranch\" ID=\"" + nodeID + "\" />"; //send xmlhttprequest for getting branch
           var xmlDoc = ReadData(SendData(data)); //read the response as xml document
           var nodes = xmlDoc.getElementsByTagName("Node[@HasChilds=\"True\"]");
           for (var n = 0; n < nodes.length; n++) {
               var nodeID = nodes[n].getAttribute("ID");
               if (ShouldBeExpanded(nodeID)) {
                   CollapseExpand(nodeID); //again send xmlhttprequest for getting childs
               }
           }




I wat to display an animated message before ExpandAll and hide it after ExpandAll is finished

Is it possible?

Thank you
Posted
Comments
Ankur\m/ 7-Sep-10 5:22am    
Please do not click 'Add an Answer' if you are not answering the question.
To discuss with a responder, use 'Add Comment' below his/her answer. The user gets a notification of your comment and not answer.

1 solution

Have a look here, JQuery Ajax[^]

You don't need two aspx pages. Your ajax script can call a PageMethod or web service to get the requested data.

Calling a PageMethod with jQuery[^]
 
Share this answer
 
Comments
Dalek Dave 7-Sep-10 4:20am    
I like that.
Ankur\m/ 7-Sep-10 5:18am    
[moved from answer]
nisha4285 wrote: Thank you for your replay I'll try it...
Ankur\m/ 7-Sep-10 5:18am    
[moved from answer]
nisha4285 wrote:
Unfortunately, it's not helping me, please does anyone has a clue?

Thank you.
[no name] 7-Sep-10 6:45am    
What part are you having problems with? The links given have clear examples.
nisha4285 7-Sep-10 20:10pm    
I'm not familiar with jquery at all, means that I won't be able to finish my project at time.

Please does anyone know how to display an animated message while sync xmlhttprequest is being sending?

And maybe someone can look at the code above and tell me what should I change?

I wrote a treeview and I want to implement Expand All method, what I'm doing is getting the roots rows and for each one get it's branch using xmlhttprequest, and if shouldbeexpanded then get it's html childs again using xmlhttprequest (each time I create a new request).

Thank you again

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