Open aspx page as a modal popup

Rajat banerjee picture Rajat banerjee · Aug 4, 2011 · Viewed 33.9k times · Source

I have a grid with edit option ,and on edit button click i need to redirect to an edit page . the requirement is to get this edit page as a popup with background (prev page) greyed out.

i tried modal popup, but the controls are on a separate page .

i tried modal popup with panel and a Iframe : this works..but thean another problem arises.i need to close the page on 'SAVE' or 'Cancel' butotn click .these controls would be on the edit page and not on the prev page .any help is appreciated .

Thanks Rajat

Answer

Safran Ali picture Safran Ali · Aug 4, 2011

i'll strongly suggest to use user control as it'll be more handy for you to manage and there is no point creating a whole page for it bcz modal popup uses ajax request and if you try to load the page in it then you have to do form post ... which doesn't go along either use ajax request or form post back ...

plus i was looking for the answer of ur question and i came across this article where it says:

You May use Modal Popup Extender to open some part of the page as Popup. But there we don't have any property to open other html or aspx page in Popup window.

http://wiki.asp.net/page.aspx/1378/open-different-page-using-ajax-modal-popup-extender-control/

and also found people asking same question as you did and the response they got is here

use Iframe or user control

Is there a way to open another page using ModalPopup Extender?

and i'll suggest to modify your design as it doesn't do any harm, instead it'll be much more helpful ...

hope this help ...