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

Showing radwindow multiple times

5 Answers 197 Views
Window
This is a migrated thread and some comments may be shown as answers.
David Blok
Top achievements
Rank 1
David Blok asked on 15 Dec 2009, 10:26 AM

I have a problem everytime i execute the code to open the radwindow, it open multiple times

1ste time it open 1 time
If i close the windows and execute the the code again i get 2 windows ... and so on

Radwindowmanager:

 <telerik:RadWindowManager ID="Menuradwindow" runat="server">  
</telerik:RadWindowManager>      
 

Execute window :

                Dim newWindow As New RadWindow()  
                newWindow.NavigateUrl = "~/admin/content/delete_page.aspx?PageID=" + panelBarValue  
                newWindow.VisibleOnPageLoad = True 
                newWindow.Width = "550" 
                newWindow.Height = "350" 
                newWindow.Title = "Pagina Verwijderen" 
 
                Menuradwindow.Windows.Add(newWindow) 

Anyone has a solution to this problem ?

5 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 15 Dec 2009, 11:45 AM
Hello David,

Since Q3 2009 when a RadWindow is declared in  RadWindowManager it preserves its ViewState which was not so in previous versions. This could lead to backwards incompatibility when the VisibleOnPageLoad property is used in this configuration with the idea to show the RadWindow only once. Possible solutions for this case are the following ones:
  • Set EnableViewState = "false" for the RadWindowManager
  • Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario
  • Show the RadWindow through registering a script from the server instead.

 


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David Blok
Top achievements
Rank 1
answered on 15 Dec 2009, 12:00 PM
EnableViewState = "false" fixed the problem of multiple windows, but only with a page refresh the last window will reopen.

But the biggest problem has been solved, thanks
0
Wendy Hunt
Top achievements
Rank 2
answered on 27 Jan 2010, 04:51 PM
I had the same problem and adding EnableViewState="false" fixed my problem too.  Thanks for the resolution!

wen
0
Kannan
Top achievements
Rank 1
answered on 29 Jul 2013, 02:00 PM
Hi,

Rad window showing multiple times  as you mentioned

enable view state false

You told open a window using script instead of code behind can you give the example ?

followed your solution but it is not working for me

Thanks,
Kannan
0
Danail Vasilev
Telerik team
answered on 01 Aug 2013, 09:03 AM
Hello Kannan,

I have tried to reproduce the unexpected behavior to open multiple RadWindows when the ViewState of the RadWindowManager is disabled, but to no avail. Could you please have a look at the short video in the attached archive and then tell me what I am missing?

Could you also try to reproduce the issue with the attached VS example and then tell me what changes you have made, so that I can make an investigation locally?

You can also put a flag that loads the RadWindow only on the first page load. For example:
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    If Not IsPostBack Then
        Dim newWindow As New RadWindow()
        newWindow.NavigateUrl = "http://www.bing.com"
        newWindow.VisibleOnPageLoad = True
        newWindow.Width = "550"
        newWindow.Height = "350"
        newWindow.Title = "Pagina Verwijderen"
 
        Menuradwindow.Windows.Add(newWindow)
    End If
End Sub

Regarding the example, on how to open RadWindow from the server, you can find it in Opening RadWindow from the server forum thread. You can also find useful Executing JavaScript function from server-side code help article.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Window
Asked by
David Blok
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
David Blok
Top achievements
Rank 1
Wendy Hunt
Top achievements
Rank 2
Kannan
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or