Posted 30 June 2026, 11:11 am EST
UserControl MessageDialog.ascx:
<cc2:C1Dialog ID="C1Window1" runat="server" Height="250px" Width="500px"
Title="Notification Dialog"
Resizable="False"
ShowOnLoad="False"
>
<CaptionButtons>
<Close Visible="false" />
<Pin Visible="false" />
<Refresh Visible="false" />
<Toggle Visible="false" />
<Minimize Visible="false" />
<Maximize Visible="false" />
</CaptionButtons>
<Content>
...
<asp:Label ID="lblMessage" runat="server" CssClass="minititle"></asp:Label>
...
ascx.cs
public void Show(MessageDialogOptions options)
{
show(options);
}
public string Message
{
set { lblMessage.Text = value; }
get { return lblMessage.Text; }
}
private void show(MessageDialogOptions options)
{
if (options.Title != null) Title = options.Title;
if (options.Message != null) Message = options.Message;
if (options.Icon != null) Icon = options.Icon.Value;
if (options.DialogButtons != null) DialogButtons = options.DialogButtons.Value;
if (options.AcceptButtonText != null) AcceptButtonText = options.AcceptButtonText;
if (options.CancelButtonText != null) CancelButtonText = options.CancelButtonText;
if (options.OnAcceptButtonClientClick != null) OnAcceptButtonClientClick = options.OnAcceptButtonClientClick;
if (options.OnCancelButtonClientClick != null) OnCancelButtonClientClick = options.OnCancelButtonClientClick;
if (!string.IsNullOrEmpty(options.Width)) Width = new Unit(options.Width);
if (!string.IsNullOrEmpty(options.Height)) Height = new Unit(options.Height);
if (!IsPostBack)
{
//C1Window1.ShowModalWindowOnLoad = true // NO EXISTE ShowModalWindowOnLoad en 2025v2 399
C1Window1.ShowOnLoad = true;
}
else
{
string script = string.Format(@"window.{0}.Show({{ title:'{1}',message:'{2}',icon:{3},buttons:{4}, width:'{5}', height:'{6}' }});", ClientID, Title, System.Web.HttpUtility.JavaScriptStringEncode(Message), (int)Icon, (int)DialogButtons, Width.ToString(), Height.ToString());
clientScripts.Add(script);
}
}
Master
<%@ Register Src="~/Controls/MessageDialogNEW.ascx" TagName="MessageDialog" TagPrefix="uc1" %>
...
<body id="Body" runat="server">
<form id="form1" runat="server" submitdisabledcontrols="True">
<asp:ToolkitScriptManager ... </asp:ToolkitScriptManager>
<asp:ScriptManagerProxy ... </asp:ScriptManagerProxy>
... <asp:UpdatePanel ID="UpdatePanelClock" runat="server" UpdateMode="Conditional">...
</asp:UpdatePanel>
...
<cc1:C1Menu ID="C1Menu1" runat="server" Height="23px" Width="295px" OnLoad="C1Menu1_Load"... </cc1:C1Menu>
<asp:Panel ID="DivContentPlaceHolder1" runat="server" class="contenido"
DefaultButton="btnGridFilterProxy">
<asp:Button ID="btnGridFilterProxy" runat="server" Style="display: none"
OnClientClick="return false;" UseSubmitBehavior="false" />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</asp:Panel>
...
<asp:ContentPlaceHolder ID="ContentButtons" runat="server">
</asp:ContentPlaceHolder>
<uc1:MessageDialog ID="MessageDialog1" runat="server" />
</form>
</body>
</html>
Master.cs
private void showMessageDialog(MessageDialogOptions options)
{
MessageDialog1.Show(options);
}
public void ShowMessageDialog(MessageDialogOptions options)
{
showMessageDialog(options);
}
event throw error in another ascx (base class BaseUserControl)
protected override void OnInit(EventArgs e)
{
...
}
catch (Exception ex)
{
Logger.Error(ex);
ShowMessageDialog(new MessageDialogOptions
{
Title = GetTranslation(20),
Message = GetTranslation(42),
Icon = DialogIcon.Error,
DialogButtons = DialogButtons.OkOnly,
});
}
Base Class: BaseUserControl
public void ShowMessageDialog(MessageDialogOptions options)
{
if (CurrentPage is ContentBasePage)
{
(CurrentPage as ContentBasePage).CurrentMaster.ShowMessageDialog(options);
}
thanks a lot , I hope you can reproduce the behavior