Showing radwindow multiple times

6 posts, 1 answers
  1. David Blok
    David Blok avatar
    42 posts
    Member since:
    Nov 2009

    Posted 15 Dec 2009 Link to this post

    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 ?
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 15 Dec 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Blok
    David Blok avatar
    42 posts
    Member since:
    Nov 2009

    Posted 15 Dec 2009 Link to this post

    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
  5. Wendy Hunt
    Wendy Hunt avatar
    50 posts
    Member since:
    Nov 2009

    Posted 27 Jan 2010 Link to this post

    I had the same problem and adding EnableViewState="false" fixed my problem too.  Thanks for the resolution!

    wen
  6. Kannan
    Kannan avatar
    14 posts
    Member since:
    Jul 2013

    Posted 29 Jul 2013 Link to this post

    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
  7. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 01 Aug 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017