Open different page using Ajax Modal PopUp Extender Control
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.
We can do it using IFrame control. What we have to do, just add IFrame control in Panel that you want to Popup and load the page in that IFrame.
Below is the sample code. Note that I've left out CSS part here.
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lnkPopup" PopupControlID="panOpen" BackgroundCssClass="ModalBackground" CancelControlID="btnCancel" PopupDragHandleControlID="panOpen" > </ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="panOpen" runat="server" Height="400px" Width="400px" CssClass="ModalWindow">
<IFRAME id="frame1" src="SourcePage.Extension / URL of the external Site" Scrolling="auto">
<asp:Button ID="btnCancel" runat="server" Text="Close" />
<a id="lnkPopup" runat="server">Show Popup</a>
Revision number 3, Thursday, July 15, 2010 5:27:59 PM by Chintan Dave
You must Login to comment.
Wed, Sep 1, 2010 7:29 AM
I have a gridview control on my page which contains a LinkButton/HyperLink control in each row. Now on click of this LinkButton control I want to show a panel with the help of ModalPopupExtender in which I want to show more data about that particular row by passing the ID of that row. I have three problems in that: How to fetch the ID of that particular row? How to pass the data to the ModalPopupExtender? How to fetch more data from database based on that ID dynamically?
Wed, Sep 1, 2010 9:55 AM
Well you do that by opening Modal Popup from server side. Just fetch the Id of that row on Row Command event and bind the grid on panel for more detail and after that open that panel using modalpopupextender.