PopUp Control Queries

Dec 3, 2011 at 6:29 AM


I am implementing the popup control in the manner described below but am having some issues.  What i am trying to do is utilise one instance of the pop up control but update its setting before it is shown.

I am place an instance of the OfficeWebUI Popup control, and define Content to contain a Placeholder within my masterpage as below: 
    <OfficeWebUI:OfficePopup ID="GeneralPopUp" runat="server" Height="450" Width="750">
            <asp:PlaceHolder ID="PopUpPlaceholder" runat="server"></asp:PlaceHolder>       

Within my master page codebehind I make both the Popup and Placeholder controls public:

public OfficePopup MainPopUp { get { return this.GeneralPopUp; } } 
public PlaceHolder MainPopUpPlaceHolder { get { return this.PopUpPlaceholder; } }

To use the popup I am inserting a dynamic Large Item to the ribbon on Init, bound to a method that will do the showing and setting of the popup, set the placeholder to the control i want to use and try to set the clickok event to an event within the loaded control.  This event will do logic and then hide the control if successful as below:


OfficeWebUI.Ribbon.LargeItem lLargeItem3 = new OfficeWebUI.Ribbon.LargeItem(); 
lLargeItem3.ID = "btnImport"; 
lLargeItem3.Text = "Import"; 
lLargeItem3.Click += new EventHandler(ViewImportScreen); 

   void ViewImportScreen(object sender, EventArgs e)

            Control c = (importsections)LoadControl("import.ascx");
            (Page.Master as SystemMaster).MainPopUp.ClickOk += new EventHandler(((importsections)c).TriggerImport);
            (Page.Master as SystemMaster).MainPopUpPlaceHolder.Controls.Add(c);

            (Page.Master as SystemMaster).MainPopUp.Title = "Import Window";           
            (Page.Master as SystemMaster).MainManager.Resources.Text_Ok = "Import";
            (Page.Master as SystemMaster).MainManager.Resources.Text_Cancel = "Cancel";       
            (Page.Master as SystemMaster).MainPopUp.Show();           


--In Loaded Placeholder control.

public void TriggerImport(object sender, EventArgs e) 
	(Page.Master as SystemMaster).MainPopUp.Hide(); 

So from all this the following works:

I manage to add Button, and popup is loaded, with the control loaded in the placeholder i want.  However the title does not change and the Button text are not changing either and the clickOk event of the popup does not fire the TriggerImport event.

If i move the clickOk event in the OnInit then the event is trigger, (the title and text is still don't change but), however if i have multiple buttons in my ribbon that should behave the same way then it is pointless setting in OnInt because I will not be able to load the appropriate controls in the placeholder.

Any idea, or things i am missing here?

(re title i saw that release 2.4.1 should tackle this issue, not sure if last release is it, but it didn't solve the problem for me.

Your help will be greatly appreciated