tags:

views:

378

answers:

3

Hai,

I am using 1 main update panel which contains Search criteria and a Search button. In side this main update panel I am using 4 update panels. These four update panels fetching search results from different 4 SQL quires. Currently I did this. But my question is, currently the page will come to display after fetching all all 4 update panels. But I needed, If one panel get full record that one panel will come to display. then next filed panel.... Like this. Please help me.
A: 

If I understand you correctly, you want the inner UpdatePanels to update consecutively when the outer UpdatePanel is updated? If this is correct then by default, all nested UpdatePanels will be updated when the parent UpdatePanel is updated.

It sounds like it would be better to not have the outer UpdatePanel, set a trigger on (inner) UpdatePanel 1 to update when search is clicked, set a trigger on UpdatePanel 2 to update when UpdatePanel 1 updates, etc, etc.

Alternatively, you could implement AJAX calls to Page Methods or Web services to populate the contents of the UpdatePanels and do away with the UpdatePanels instead.

Russ Cam
If I removed outer main update panel, the page will get full post back. This is not allowed.
Are you sure about that? It's been a while since I used UpdatePanels, but IIRC, the full page postback gets intercepted if the submit button is an AsyncPostbackTrigger for an UpdatePanel (in this case, set it as an AsyncPostbackTrigger on (inner) UpdatePanel 1).
Russ Cam
Hai, I have one problem here. I tried in the AsyncPostbackTrigger method. But here I am using webusercontrols in the pages. That is the main outer udatepanel in one user control. In side this, the 4 update panel appear in side 4 user contols. So, If I try to use AsyncPostbackTrigger it expects the SearchButton inside the same user control. Please hel me.
Could you edit your original question and update it with the comments you have made and also post your aspx page code, along with any relevant .NET code
Russ Cam
A: 

Jason I think you problem may stem from the fact that you have nested your 'SQL' UpdatePanels within the 'Search' Update panel. You may want to separate them and look at AsyncPostBack triggers to get all four to fire once you have entered search critera.

I will enter the search criteria in main update panel and click the search button. The innter 4 update panels will load their datagrid using the above search criteria. Now this process is correctly working to me. But my question is, currently the will display the search result only after fetching 4 update panels. This not allowed. If one update panel fetched records immediately it will show to user, then after fetching second update panel, the page will show that one ..... . The inner panels were used only for display search records. No updation there. Please help me.
Again I would look at where the search cmd is fired, on the main updatepanel. Un nesting these datagrid updatepanels will make them post independently with an UpdateMode set to 'Conditional' and your search button as a trigger on each datagrid UpdatePanel.
The AsynPostBackTrigger will give you the ability to do a 'partial' postback on you 'Search' button.
Hai, I have one problem here. I tried in the AsyncPostbackTrigger method. But here I am using webusercontrols in the pages. That is the main outer udatepanel in one user control. In side this, the 4 update panel appear in side 4 user contols. So, If I try to use AsyncPostbackTrigger it expects the SearchButton inside the same user control. Please hel me.
A: 

The question is not clear, but you can check the results of the four queries in the Selected event of each of the DataSourceControls you use (I suppose you do), and if you find a record in a set displayed in the previous set, then apply your custom adjustment.

A side question: why using 4 update panels while the whole 5 panels are triggered by the same source (the search button)?

Ashraf Sabry
Hai, actually the Main update panel has Search Criteria only, the inner update panels have separate separate paing buttons. Please help me.
I'm still not clearly understanding, but if you want to populate the data in the 4 panels sequentially in response to user activity, then you should handle certain events for the 1st grid (RowSelecting for example) and populate the next grid with code (grid.DataBind()), but don't let them bind themselves automatically in response to the search button clicks.
Ashraf Sabry