0

Requirement

In User control ( In single update panel) - user will change some data and click on button or link button other than save button

We prompt Dialog box to user for (Yes/No/Cancel)

On cancel we did nothing and remain on same page

On No - we redirect/process further without saving data.

On Save we have to save changes and redirect/process further.

Here the problem is with Save

We have different panels on page (same on user control)

On Selection of Yes, Here we call "_doPostBack" for save button click event (Works fine), and in same javascript function below save postback calls other "_doPostBack" to hide current panel (Panel-1) and show another one (Panel-2) and server side process.

But Its always shows (Panel-1) However in FF, Panel-2 just prompt and hide again.

EDIT: Hide panels are at server side, as there are multiple buttons which shows/hide panels.

Expected result is : After save data, show Panel-2 and hide Panel-1

can anyone has idea how to overcome this prob ?

  • Have you ever tried getting your car fixed over the phone, without showing it to your mechanic ? Same thing here, it's always quite hard to debug some code if we don't see anything of it... – Laurent S. Apr 11 '14 at 11:12

1 Answers1

0

Without some actual code it is a bit difficult to see what is going on, but from what I understand it is a problem with timing.

When you click 'Yes', you perform the postback function and immediately after you hide the panel. Your 'doPostback' is actually a-synchronous. Meaning the response comes a bit later (not immediately). Thus when the response comes back it updates your page and that is where you flow is breaking up.

FF is probably fast enough to actual show you what is really happening. Your hide function works ok, but is overwritten by the ajax response.

I suggest you hide the panel asynchronously, with the response that comes from the server.

Here are some links on that: - RegisterClientScriptBlock within AJAX method call

RegisterStartupScript doesn't work with ScriptManager,Updatepanel. Why is that?

I hope this helps you get on the right track.

Good luck

Community
  • 1
  • 1
Thor
  • 291
  • 2
  • 8