This is a migrated thread and some comments may be shown as answers.

VisibleOnPageLoad only works once?

3 Answers 164 Views
Window
This is a migrated thread and some comments may be shown as answers.
Blasty
Top achievements
Rank 1
Blasty asked on 03 Aug 2009, 08:16 PM
Ok, so I have a page that sets visibleonpageload for a radwindow to true in the codebehind after a button click.

This works fine so long as the window is closed by the exit button in the top right.

But if I close the window by using the client side functionality   like this.

        function GetRadWindow() {  
            var oWindow = null;  
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog  
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)  
            return oWindow;  
        }  
        function returnArg(arg) {  
            var oWnd = GetRadWindow();  
            if (oWnd) {  
                oWnd.close(arg);  
            }  
            else {  
                alert('oWnD Null');  
            }  
        }  
            


after this I can't get the visibleonpageload = true to work.  the page reloads on button click, but doesn't show the window.

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 04 Aug 2009, 05:44 AM
Hi Blasty,

Please provide more details about your exact setup. What is your RadWindowManager / RadWindow declaration and how exactly do you open the RadWindow control. I am asking you this because the code that you posted is fine and should not raise such problem. The reason for this behavior is somewhere else, but without having a better look over your case I cannot be of much help.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Blasty
Top achievements
Rank 1
answered on 04 Aug 2009, 02:45 PM
Here is the codebehind
        /// <summary>  
        /// Sets the radwindow navigateurl and pageload visibility.  
        /// </summary>  
        /// <param name="processorResponse">The processor response.</param>  
        private void SetSecure3D(ProcessorResponse processorResponse)  
        {  
            winVerify3D.NavigateUrl = "Secure3d.aspx;
            winVerify3D.ShowContentDuringLoad = true;
            winVerify3D.VisibleOnPageLoad = true;
            ShowResults("Display 3D Secure Transfer Window." );  
 
        } 

The showresults method was merely a method that shows a message in a asp label control on the page.  just there to help me make sure that those lines of code are being hit and they are everytime.

                           <telerik:RadWindow ID="winVerify3D" VisibleOnPageLoad="false" runat="server" Animation="Fade" Modal="True" 
                                Title="Verify Secure3D"  Width="600" Height="500" OnClientClose="GetPaResOnClientClose" 
                                ShowContentDuringLoad="false">  
                            </telerik:RadWindow>   

Above is my radwindow declaration, you can see it has an onclientclose event, provided here.

        function GetPaResOnClientClose(sender, eventArgs) {  
            var arg = eventArgs.get_argument();  
            if (arg) {  
                var txPaRes = document.getElementById("txtPaRes")  
                if (txPaRes) {  
                    txPaRes.value = arg;  
                  InitiateAjaxRequest('None');  
                }  
            }  
        } 

everything works fine in regards to first time through, but if I click my button again, it fires my codebehind, put the radwindow isn't visible on pageload.
0
Blasty
Top achievements
Rank 1
answered on 04 Aug 2009, 03:16 PM
I believe I managed to fix my problem by going to this thread here

http://www.telerik.com/community/forums/aspnet-ajax/window/open-radwindow-server-side-fires-only-once.aspx

I was using a radajaxmanager, and even though I thought I configured it correctly, I guess I didn't.  Specifically in  my case I needed the radajaxmanager to have the main submit button listed as a control that causes requests, and the radwindowsmanager had to be listed as one of the controls it updates.
Tags
Window
Asked by
Blasty
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Blasty
Top achievements
Rank 1
Share this question
or