Wednesday, June 13, 2012

showModalDialog not returning value after a postback in Chrome

There is a bug in the Chrome browser engine, which is showModalDialog fails to return window.returnValue after childpage do any postback. This issue has been there for long time and status of the this issue is still available. More information on this issue can be found here.

For a solution for this issue update panels can be used to avoid unnecessary postbacks but this solution is not extendable for all the scenarios. The best solution posted in the stackoverflow can be found here.  What has done in this solution is, it uses the window.operner return value to get the return value in the Chrome. After postbacks also window.opener property in the modal dialog points to the caller window, so the result can be directly set to the returnValue property of the caller window(parent window).

No comments:

Post a Comment