We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Set Dialog control default to false


I have a C# based website, where I have started to use the Syncfusion asp.net Dialog control. (www.recognitiongame.com)

My problem:
I set the default behaviour of the Dialog Control with ShowOnInit(false).
But when the page loads, the dialog blink for a moment. It's annoying.

How can I set the Dialog opening, showing false by default?
(Visible="false" not good, because I can't set back by jquery.)


3 Replies

AP Arun Palaniyandi Syncfusion Team June 21, 2017 12:29 PM UTC

Hi Imre Revesz,  
Thanks for contacting Syncfusion support.  
We can achieve this scenario by setting the style attribute for Dialog’s parent element as, display none in the code behind. Hence this will not show the Dialog content blink and display Dialog, only when we open it. Please find the below code snippet for you reference.  
        <div id="Dialog" runat="server">  
        <ej:Dialog ID="basicDialog" ShowOnInit="false" IsResponsive="True" Width="550"MinWidth="310px" MinHeight="215px" ClientSideOnClose="onDialogClose"Containment=".control" runat="server" Title="Audi Q3 Drive">  
Code behind:  
protected void Page_Load(object sender, EventArgs e)  
            this.Dialog.Style.Add("display", "none");  
Please find the below sample for your reference.  
Please check the shared sample and if the sample still not meet your requirement, please send us more information so that we will provide a solution.          
Arun P.      

IR Imre Revesz June 21, 2017 08:22 PM UTC


Thanks, it works perfectly.



AP Arun Palaniyandi Syncfusion Team June 22, 2017 06:51 AM UTC

Hi Imre, 

We are glad that our solution has helped you out. 

Please let us know if you have any queries in future. 

Arun P. 

Live Chat Icon For mobile
Up arrow icon