Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

How to keep webdialog as modal after asynchronous postback

Last post 10-07-2008 16:03 by [Infragistics] Viktor Snezhko. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 08-22-2008 3:44

    How to keep webdialog as modal after asynchronous postback

     Hi,

     

     I  use webdialog as a wizard. The wizard requires heavily server-side operation. Therefore, i need to do asynchronous postback. However, if i do so, the modality of the webdialog is lost. The background shadow disappears, the webdialog comes back its initial position and the modality behavior is lost. Here is my setup roughly:

    <UpdatePanel>

        <WebDialogWindow>

            <ContentPane>

            <Template>

                    <asp:Button ID="Button1" OnClick="Button1_Click"> 

            </Template>

           </ContentPane>

        </WebDialogWindow>

    </UpdatePanel>

     

    When I click Button1, the server side operation is done but the modality of the webdialog is lost.  How can i handle this problem?

     

    Thanks in advance...

     

    • Post Points: 35
  • 09-01-2008 10:30 In reply to

    Re: How to keep webdialog as modal after asynchronous postback

    Hello,

    This one could be very tricky. You will need to subscribe to the EndRequest client-side event of the built-in ASP.NET RequestManager and in the javascript event handler show the Modal Window again using javascript  (and the WebDialogWindow Client Side Object Model (CSOM).

    Example:

    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(EndRequest);   
     
        function EndRequest (sender, args)

        {
            $find("<%= WebDialogWindow1.ClientID %>").show()

       }
       
       
    </script>

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 41
  • 09-11-2008 14:25 In reply to

    Re: How to keep webdialog as modal after asynchronous postback

    This solution does not fix the problem. The problem is not getting the dialog to show again, it is that it is not modal when it does show again. Any type of async postback on the dialog seems to cause this behavior. Example:

    Put a grid on the dialog with paging. The grid will page async like it should, but after the first page the dialog is no longer modal. If you close the dialog and reopen it, the dialog is not modal.

    The lack of support for async postbacks on the dialog severly cripples its usefulness. Outside of popping up informational messages, I seem to always encounter this bug. 

    • Post Points: 5
  • 09-17-2008 10:27 In reply to

    • levon
    • Top 500 Contributor
    • Joined on 01-04-2008
    • Points 254

    Re: How to keep webdialog as modal after asynchronous postback

     It looks like css class that was assigned to ModalBackgroundCssClass property is not applied after asynch postback.  

     WebDialogWindow is inside an UpdatePanel.

     After a asynchronous postback, the dialog window shows up but the ModalBackgroundCssClass css is not applied.

     Is  WebDialogWindow not compatible with UpdatePanel?

     Here is my code 

    FrontEnd:

     <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <div>
                <asp:UpdatePanel ID="upanel" runat="server" ChildrenAsTriggers="true">
                    <ContentTemplate>
                        <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px" Width="400px"
                            Modal="true" Moveable="true">
                            <ContentPane>
                                <Template>
                                    <asp:Button ID="btnOK" runat="server" Text="okay" OnClick="btnOK_Click" />
                                </Template>
                            </ContentPane>
                        </ig:WebDialogWindow>
                        <asp:Button ID="btnShow" runat="server" Text="show window" OnClick="btnShow_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
        </form>
    </body>
    </html>

     

    Code Behind:

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

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

     

    • Post Points: 5
  • 10-06-2008 15:57 In reply to

    • hchan
    • Not Ranked
    • Joined on 06-24-2008
    • Points 20

    Re: How to keep webdialog as modal after asynchronous postback

    I am trying to do the same thing, using the WebDialog for wizard. Looking at the complexity of this, is Telerik RadWindow a better fit for this initiative?

    Any suggestion is appreciated.

     

    • Post Points: 20
  • 10-07-2008 9:13 In reply to

    Re: How to keep webdialog as modal after asynchronous postback

    I decided to switch to the ModalPopupExtender that is part of the AJAX.net toolkit. It is working perfectly with async postbacks and is VERY easy to setup. The only downside is that you are responsible for the look and feel of the dialog (no themes to pick from etc). Another plus is that it is much easier to find help and examples on this control because the community is much more active with alot of posts on it.

    • Post Points: 20
  • 10-07-2008 16:03 In reply to

    Re: How to keep webdialog as modal after asynchronous postback

    Hi,

    Persistance of modal state was fixed awhile ago. I think that it should be available in hot fixes. If latest hot fixes do not have that, then it should be next fix for sure.

    Regards,
    Viktor
    Infragistics web team
    • Post Points: 5
Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems