This example demonstrates how to manipulate objects inside ASPxPopupControl with a specified ContentUrl property.
To access/manipulate client-side programmatic objects inside a ASPxPopupControl perform the following steps:
1) Call the ASPxPopupControl.Show method and handle the ASPxPopupControl's Shown event (this is necessary because the DOM tree for ASPxPopupControl has not been built yet, and that's why we can't get references to objects inside the ASPxPopupControl until it is shown);
2) Get the contentWindow object of the ASPxPopupControl IFrame via the ASPxClientPopupControl.GetWindowContentIFrame method;
3) Get any object from this window and manipulate it.
Note: Iframe isn't fully loaded in the Shown event when the popup is shown for the first time. It is necessary to handle the load event of iframe and call the necessary functions in the event handler.
Default.aspx:
[ASPx]<dx:ASPxLoadingPanelID="ASPxLoadingPanel1"ClientInstanceName="loadingPanel"Modal="true"runat="server"></dx:ASPxLoadingPanel><dx:ASPxComboBoxID="cmb"runat="server"ClientInstanceName="clientCmb"><Items> ...</Items><ClientSideEventsSelectedIndexChanged="OnSelectedIndexChanged"/></dx:ASPxComboBox><dx:ASPxPopupControlID="popup"runat="server"ContentUrl="~/ContentPageWithTextBox.aspx"Top="100"ClientInstanceName="clientPopup"CloseAction="CloseButton"><ClientSideEventsShown="OnShown"/></dx:ASPxPopupControl>
[JScript]var iframeLoaded = false;function OnPopUp(s, e){ loadingPanel.Show();}function OnSelectedIndexChanged(s, e){if(clientPopup.IsVisible()) SetTbText();else clientPopup.Show();}function OnInit(s, e){var iframe = s.GetContentIFrame(); iframe.onload = function(){ iframeLoaded = true; SetTbText();}}function OnShown(s, e){if(iframeLoaded) SetTbText();}function SetTbText(){var contentIFrameWindow = clientPopup.GetContentIFrameWindow();var contentTextBox = contentIFrameWindow.clientTb;if(contentTextBox) contentTextBox.SetText(clientCmb.GetText()); loadingPanel.Hide();}
ContentPageWithTextBox.aspx:
[ASPx]<dx:ASPxTextBoxID="tb"runat="server"Width="150px"ClientInstanceName="clientTb"></dx:ASPxTextBox>