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


Dear All

I am triggering this function by a button
            <ej:Button ID="btnFitToPage" runat="server" Text="FitToPage" CssClass="button" ClientSideOnClick="fittopage" ShowRoundedCorner="true"></ej:Button>

<asp:Content ID="Scripts" ContentPlaceHolderID="ScriptSection" runat="server">
    <script type="text/javascript">
        function fittopage(e) {
            var diagram = $("#diagram").ejDiagram("instance");
                diagram.fitToPage("page", {
                    left: 5,
                    top: 5,
                    right: 5,
                    bottom: 5

As I can see the resize is working as expected, but 3 seconds later the page is cleared. 
What did I do wrong?

Thanks for help

2 Replies

MS Martin Sickel November 7, 2016 02:30 PM UTC

Dear All

found the issue by myself, I had to ad Type="Button" into the Button ant the Page, now it worked as expected.

SG Shyam G Syncfusion Team November 8, 2016 04:22 AM UTC

Hi Martin, 
Please let me know if you need further assistance on this. 
Shyam G 

Live Chat Icon For mobile
Up arrow icon