0

I have 3 update panels on a page. Each of them is set to conditionally update. In each update panel I have a single button control that when clicked will populate the panel with data. Each panel is independent of one another.

Everything is working fine when you manually click each one of the 3 buttons in their respective panel. The issue I am having comes up when I use JavaScript to click the buttons. I have success when executing a single JavaScript call but when I try to click all 3 buttons with JavaScript, things behave sporadically. Depending on where I place the JavaScript calls in my code, different panels work and the others do not.

For example:

__doPostBack('btnBindTeamTicketList', '');
__doPostBack('btnBindPriorityList', '');
__doPostBack('btnSearchTemplate', '');

will show the panel that holds the 'btnSearchTemplate' button, but not the others. Different results occur when I change the sequence around.

Is there a way to click my 3 independent buttons (each in its respective panel) using JavaScript so that each panel will load as if I were clicking on them individually? I am guessing this has to do with the AJAX somehow conflicting with each other or a timing problem. Anyone point me in the right direction?

I am using ASP.NET 3.5/C#

1 Answer 1

1

I think you should do one postback. Put a hidden update panel in your page and put a button inside this new update panel. This button should call events

  • btnBindTeamTicketList_Click(null, null)
  • btnBindPriorityList_Click(null, null)
  • btnSearchTemplate_Click(null, null)

and should update the other update panels like upTeamTicketList.Update(). Now try clicking this new button.

Sign up to request clarification or add additional context in comments.

1 Comment

You can also quit update panels and start using jQuery AJAX with this article. You can load content whitout ASP.NET's bulky postbacks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.