RadWindow loses properties set in code-behind on postback

5 posts, 1 answers
  1. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 06 Oct 2009 Link to this post

    I'm have the RadWindowManager and a RadWindow object in my aspx page and I set the NaviagteUrl, OpenerElementId and OffsetElementId proeprties in the code-behind of my page for the RadWindow. Now on the first page load every this works correctly. Now if a postback occurs on the page, the RadWindow loses all those properties I set.

    I've overcome this problem by setting those properties on every postback, but it becomes difficult to do on certain forms I use, since its not possible for me to do that.

    So I just wanted to know if this is this a bug or something?

    Thanks.
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 06 Oct 2009 Link to this post

    I thought I should mention that I'm setting those properties in the Page_Load event.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 08 Oct 2009 Link to this post

    Hi robertw102,

    I tried to reproduce the problem locally, but as you can see from the attached movie, everything worked as expected. Below is the codebehind for my test:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadWindow1.NavigateUrl = "http://www.google.com";
        RadWindow1.OpenerElementID = WindowButton.ClientID;
        RadWindow1.OffsetElementID = WindowButton.ClientID;
    }


    Please open a support ticket and send us a small sample project where this issue could be reproduced so we could check it.

    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.
  5. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 08 Oct 2009 Link to this post

    Yes that code block works, but that's because it's setting those settings every time the page is posted back. If you change it to this:
    protected void Page_Load(object sender, EventArgs e) 
        if (!IsPostBack) 
        { 
           RadWindow1.NavigateUrl = "http://www.google.com"
           RadWindow1.OpenerElementID = WindowButton.ClientID; 
           RadWindow1.OffsetElementID = WindowButton.ClientID; 
        } 
    When the page load event is setup like above, where the settings are only set on the first page request, not on every post back, the associated button works when the page loads, but if you submit the form with another button causing a post back to occur, those settings disappear and the associated button now post backs instead of calling the window.

    Try that and tell me if you experience the same behavior.

    Thanks.


  6. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 09 Oct 2009 Link to this post

    Hi robertw102,

    Thank you for the additional details - I reproduced the problem and we will do our best to fix it for one of the following updates.

    Your points were updated.


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