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

RadWindow - reopens during page postback ..

1 Answer 131 Views
Window
This is a migrated thread and some comments may be shown as answers.
FISCAL
Top achievements
Rank 1
FISCAL asked on 10 Aug 2011, 12:43 PM
Hi,

I am having a problem with RadWindow control. On the click of server side button control, radwindow is opened which is fine. User closes it. When Page Postback happens, it automatically opens which is undesirable. How can I get rid of this behaviour?

Code Snippet - Html Source...

<telerik:RadWindowManager ID="ExclusionWindow" runat="server" Skin="Office2007" Width="500"
        Height="400" Visible="true">
    </telerik:RadWindowManager>
..................


Code behind ..


 protected void btnSetExclusion_Click(object sender, EventArgs e)
        {
            if (Master == null) return;
            Label lblPortfolio = (Label)Master.FindControl("lblPortfolioID");
            int orgID = Convert.ToInt32(lblPortfolio.Text);
            RadWindow window = new RadWindow()
            {
                ID = "Exclusion Window",
                VisibleOnPageLoad = true,
                NavigateUrl = "frmCMExclusions.aspx?OrgID=" + orgID,
                Modal = true,
                DestroyOnClose = true,
                Behaviors = WindowBehaviors.Close
            };
            ExclusionWindow.Visible = true;
            ExclusionWindow.Windows.Add(window);
            ExclusionWindow.DestroyOnClose = true;
        }


Many thanks.

Milan G



1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 12 Aug 2011, 11:29 AM
Hi Milan,

This is the expected behavior when you set the VisibleOnPageLoad property to true - the RadWindow should reopen after every postback. What you can do is to open it correctly - via JavaScript, which is the way a RadWIndow should be opened, as it is a client-side object. You can do this by injecting the JavaScript from the server-side. More information on the available approaches can be found in the following article: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-javascript-from-server-side.html.


Greetings,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
FISCAL
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or