RadWindow IDs change/unable to use $find()

4 posts, 0 answers
  1. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 05 Dec 2007 Link to this post

    We have started using the new Prometheus RadWindow and have since gotten rid of the Window Manager since it's no longer needed. We've placed them in our master page so they are accessible anywhere. We include a javascript file on every page that allows us to call our own "OpenRadWindow" function, pass in some parameters and it will display as we want it to. In the old version of the RadWindow, we would just get the WindowManager and select the window we wanted. Now, we are using $find in our "OpenRadWindow" function. The downside to this is that the ID doesn't stay the same. On our local machines the following code works just fine to get the RadWindow:

    However, on the server, the ID is now "_ctl0_WdwClose". Is there a workaround to get the window in another way without using the rad window manager. We are unable to use server include tags to output the ID because server includes aren't usable in the included javascript file. We are running Vista on our local machines and Windows Server 2003 on the server. The code is identical in both locations.
  2. Matthew Bishop
    Matthew Bishop avatar
    57 posts
    Member since:
    Apr 2007

    Posted 05 Dec 2007 Link to this post

    Adam, I think what you are saying is the same as a problem I had, whilst this is a bit of a hack, this is what I do.
    On the server side I have this code (in c#):

    Then I can get the id by:

    Hope this helps :)
  3. DevCraft R3 2016 release webinar banner
  4. Adam
    Adam avatar
    177 posts
    Member since:
    Oct 2012

    Posted 06 Dec 2007 Link to this post

    That works great! Kind of seems stupid to have to do that, but I'm not all that surprised with the way the ASP.NET handles it.

    I had to use ClientScript.RegisterStartupScript to output the script, otherwise it would mess up the styles on my page for some reason. Luckily with them being in a master page, I only have to make this change once.

    Thanks again,
  5. Tervel
    Tervel avatar
    1337 posts

    Posted 06 Dec 2007 Link to this post

    Hi Adam,

    As you point out yourself,  this is how ASP.NET works and you would face the same situation with any serverside control that you try to get a reference to on the client side.

    To get such a reference, one would need to use the same [or a variation of] the approach provided by Matthew.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top