Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1708
Non-Standard Close button triggering an Extra Postback in IE
posted

Ok I’ve posted a similar issue.  But this time I’m getting an extra-postback even after I do a redirect away from the page that postbacked to.  The issue only affects Internet Explorer!

Let-me illustrate:
(Aspx Page A   {Webdialog 1    {Close Button}    ‘X Button’ }  )           

(Aspx Page B)

 

 

Step 1) I click the Close Button on the WebDialog1
Step 2) JavaScript I close the WebDialog1
Step 3) Page A has a Windows-StateChanged event AutoPostback event set to catch.  It fires!
Step 4) The event does a Response.Redirect to ‘Page B’.
Step 5) The Page.Load code on Page B does run… when you step through the code behind.
Step 6) Page A fires a PostBack again!!!????? (Page.PostBack = True) What? Why?  The Page display remains on Page A in Internet Explorer.  The redirect does not complete.  It will complete the redirect to Page B in FireFox.

Note if you click the ‘X’ in the top right-hand corner.  The page works as intended.  Note my Redirect below.  I tried ‘Transfer’, Execute…. Nothing will work!

CloseButton – OnClientClick

    <asp:Button ID="btnCancelVoid" runat="server" CausesValidation="False" Text="Close" OnClientClick="closeVoidWindow();" />

 

 

        function closeVoidWindow() {

            var dialogWindow = $find('<%=wdVoidRx.ClientID%>');

            dialogWindow.set_windowState($IG.DialogWindowState.Hidden, true);

        }

 

    Protected Sub wdVoidRx_StateChanged(ByVal sender As Object, ByVal e As Infragistics.Web.UI.LayoutControls.DialogWindowStateChangedEventArgs) Handles wdVoidRx.StateChanged

        If e.NewState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Hidden Then

            'Do the same the cancel button that is on the dispense form

            'btnCancel_Click(sender, New System.EventArgs) 'Redirect to the patient profile page 'Didn't work in IE

 

            'cancel the rx

            Dim fwdGUID As String = System.Guid.NewGuid().ToString().Replace("-", "")

            Dim fwd_args As New Dictionary(Of String, String)

            fwd_args.Add("MRN", hdMRN.Value.ToString)

            fwd_args.Add("PatientID", hdPatientID.Value.ToString) 'Add PatientID

            Context.Session(fwdGUID) = fwd_args

 

            'Server.Execute("~/Dispense/Profile.aspx?ID=" & fwdGUID.ToString, False)

            'Server.Transfer("~/Dispense/Profile.aspx?ID=" & fwdGUID.ToString, False)

            Response.Redirect("~/Dispense/Profile.aspx?ID=" & fwdGUID.ToString, False)

        End If

    End Sub

 

 

Parents
No Data
Reply
  • 1708
    Verified Answer
    Offline posted

    Solving the issue old school...

    I changed my 'Non-Standard' Close button from an ASP-Button to a HTML button. 

     

     

     

     

    <input id="btnCancelVoid" type="button" value="Close" onclick="closeVoidWindow();" />

    This worked without issue in IE. 

    I even tried with a ASP.NET Buton to put a 'Return False;' in the Void Function that hides the webdialogwindow, called in the OnClientClick - but that did not work.  But the above method is flawless.

    Sincerely,

    Robert

Children
No Data