Search code examples
javascriptasp.netinfragisticswindowstate

Handling Infragisitcs WebDialogWindow WindowState via javascript


protected void btnSelectCommittee_Click(object sender, EventArgs e)
    {
        this.WebDialogWindow1.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal;
    }

By using the above code, it can change the windowState of the web dialog window to visible. The problem now is it is refreshing the page. It seems that page refreshing can be avoided by using onClientClick method and call javascript function. However, I have no idea on how to update the window state of Infragistics DialogWindowState via Javascript. Please help!


Solution

  • The answer is fairly simple where it's possible to change the windowState without refreshing the page by using onClientClick="return showDialog();"

    function showDialog() {
            var dialogWindow = $find('<%=WebDialogWindow1.ClientID%>');
    
            //Using `show()` method to display the window if the windowState is hidden
            dialogWindow.show();
    
            //using `hide()` method to hide the windowState
            //dialogWindow.hide();
            return false;
        }