Recently I had to work with the ModalPopupExtender that comes with the AjaxControlToolkit. I’ve worked with it before, but this time it posed a couple of problems (that were caused not because of the toolkit, but rather other things).
Without specifying the “X” and “Y” attributes of the ModalPopUpExtender(MPE) it is supposed to, by default, render at the center of the screen. Sometimes this doesn’t happen. The solution to getting it to render at the center of the screen is adding the following doctype to your page:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
Even then, my page didn’t seem to display the popup right. Its only later that I discovered that I was using Response.flush on the page to display a “Loading…” screen. This causes the html used for the “Loading…” screen to be the first thing on the page.
Since the DOCTYPE is now forced down the page, the rest of the page does not render as per the specified DOCTYPE. This causes the MDE to render at some other position on the screen (other than the center).
To fix this, Response.Write and Flush your DOCTYPE tag first, so it becomes the first line on the page.
Friday, March 19, 2010
Subscribe to:
Post Comments (Atom)
Thank you very much I was looking for solution for hours. Changing doctype fixes the problem.
ReplyDeleteHi.
ReplyDeleteFor me works correctly with IE and chrome.
But non with FireFox...
I use versione 3.6.15.
Any suggestions?
Thx