problem with radopen

2 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 26 Jul 2011 Link to this post

    I have a menu on a master page that opens a radwindow (window1)  this window contains a radgrid.  In the radgrid I have some code that opens a second window (window2) to allow editing of the grid contents.  This works ok, but Im having a problem referencing window2 if my .aspx page is in a subdirectory and not the site root.  Heres whats happening

    I activate window2 when my main page is

    /Website/default.aspx    the page is in the root (using this bit of code var oBrowserWnd = GetRadWindow().BrowserWindow;)

    I call this code

    var oBrowserWnd = GetRadWindow().BrowserWindow;
           
     oBrowserWnd.radopen("ArtistAdmin/BandMemberEditForm.aspx?ID=" + id, "BandMemberDialog");
                 
      return false;

    the edit form is found and opens ok

    If the .aspx page happens to be in a subdirectory, eg

    /Website/ArtistAdmin/ArtistAdminPage.aspx

    the window cant be found because BrowserWindow is
    /website/artistadmin/artistadmin.aspx

    so radopen tries this


    /website/artistadmin/artistadmin/artistadmin.aspx

    How can I force radopen to use the root directory of my site ?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 27 Jul 2011 Link to this post

    Hello Mark,

    What you are using are relative paths (in your example, at least), so I would suggest that you rework your calls to use the correct relative paths. Another approach is to use the full URLs, for example http://www.mysite.com/WebApp1/Folder1/page1.aspx. There is a third approach to resolve urls in JavaScript that is inside a page - by using the server-side ResolveUrl method: var resolvedUrl = '<%= ResolveUrl("~/images/testIcon.gif")%>'; and use this variable in the radopen() call.

    Please note that which URL is loaded in the frame does not change the JavaScript window object, only its location property, therefore I believe your issue is some incorrect relative paths.

    I would also recommend that you examine your other thread on the similar matter which I answered and carefully examine my sample and the linked resources.


    Best wishes,
    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top