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

problem with radopen

1 Answer 72 Views
Window
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 26 Jul 2011, 10:43 AM
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 ?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 27 Jul 2011, 11:42 AM
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.

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