Solved

Refresh Issue using AJAX TabPanels

Posted on 2008-10-21
6
582 Views
Last Modified: 2012-05-05
I have a set of 4 AJAX TabPanels, each with a nested UpdatePanel and GridView. My grids have buttons in them that fire off add/update/delete stored procedures.

When deleting an item from Grid 1(Tab 1), I need to refresh Grid 3 (also on Tab3) as Grid 3 will now have different results (Grid 1 has users, grid 3 has tasks - when you remove a user, you remove the connection to a task for that user).

When I click the Delete button on my grid, the stored procedure runs correctly, and Grid 1 refreshes correctly, showing that user has been deleted.  However Tab 3, Grid 3 does not refresh.

At first, I thought it might be because I wasn't telling it to refresh. So I put in a call: UpdatePanel3.Update(); This does nothing. I'm at a loss here.
0
Comment
Question by:Paul Kahl
  • 3
  • 3
6 Comments
 
LVL 10

Accepted Solution

by:
GeoffSutton earned 500 total points
ID: 22771306
Instead of updatepanel3.update() try Grid3.databind() - You are refreshing the data on the grid, from the datasource.  That will work if you are using a datasource control.  if you are manually binding to a datatable, you will need to make the row as deleted in the datatable before rebindng it.

Hope this helps,

Geoff
0
 
LVL 3

Author Comment

by:Paul Kahl
ID: 22771435
You're right. I figured it out about 2 seconds after I made the post. I already have a function that does the grid3.bind, so I just called that function, and then the update:

fetchReportTypeListings();
UpdatePanel3.Update();

Worked fantastic. Thanks for confirming that as the correct methodology.
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22771512
Excellent.  I'm glad you figured it out so quickly.

Geoff
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 3

Author Comment

by:Paul Kahl
ID: 22771564
I was pretty sure I had it, but I'm glad you backed me up with your answer, or I'd have debated it well into next week. :)
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22771627
LOL I can understand that sort of thing.  A good rule of thumb that I always follow:  If it works, and it's not the "Correct" way of doing it, who cares so long as it doesn't throw errors under load testing :)

Geoff
0
 
LVL 3

Author Comment

by:Paul Kahl
ID: 22771991
Totally agree - most of my .Net code isn't "The Correct Way". But 9 times out of 10, it's the right way, and the best practice way. Thanks again.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question