How I crete a WebDialogWindow dynamically?
I try code:
Dim Dialog As New Infragistics.Web.UI.LayoutControls.WebDialogWindow() Dim L As New Label L.Text = "DESEJA REALMENTE SAIR?" With Dialog .Modal = True .ContentPane.Controls.Add(L) .Moveable = True .Header.CaptionText = "Teste Caption" .InitialLocation = Infragistics.Web.UI.LayoutControls.DialogWindowPosition.Centered .WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal .Visible = True .DataBind() End With Me.Controls.Add(Dialog)
I would still suggest you try putting in a Placeholder control to see if that helps. I've seen issues in the past with just adding the the form controls collection.
Hi,
I working with Page "child" of the a MasterPage. Then this page is CADASTROFORNECEDOR.ASPX where masterpage is MP_CADASTRO.master. The code is present in event click on button in CADASTROFORNECEDOR.ASPX.
I try
Dim Dialog As New Infragistics.Web.UI.LayoutControls.WebDialogWindow() Dim L As New Label L.Text = "DESEJA REALMENTE SAIR?" With Dialog .Modal = True .ContentPane.Controls.Add(L) .Moveable = True .Header.CaptionText = "Teste Caption" .InitialLocation = Infragistics.Web.UI.LayoutControls.DialogWindowPosition.Centered .WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal .Visible = True End With Me.Form.Controls.Add(Dialog)
But nothing happened.
I'm not sure what the context of Me is here, but if it's the Page, then you have to add it to Me.Form. All controls need to be added to the form element, not directly to the page. If Me is another container control, just be sure that you're adding that control to the Form element.
Hope this helps,
-Tony
I tried your code and had similar problems. If you add a Placeholder control to your page and add the dialog to your page using this control, I think you will have more sucess. Try it like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager runat="server" /> <asp:PlaceHolder ID="plcWindow" runat="server" /> </form></body></html>
and then in your code behind you will add the control with the following line of code:
Me.plcWindow.Controls.Add(Dialog)
HTH,
Craig