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

RadWindow NavigateUrl autoSize different webserver

2 Answers 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bjorn Sagbakken
Top achievements
Rank 1
Bjorn Sagbakken asked on 29 May 2012, 12:11 PM
Hello

I believe the title says it all.
From the documentation I know that autoSize doesn't work with navigateUrl from other domains.
But i am adressing another webserver in the same domain, and autoSize still doesn't work.
However, with a page from the running application in the navigateUrl it works.

Any ideas?

Thanks
Bjorn Sagbakken

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 31 May 2012, 04:01 PM
Hello Bjorn,

Can you access the problematic page via JavaScript or does it throw an error that the access is denied? For example, when you try calling a function from the same page when loaded in an iframe:
<iframe src="http://otherserver/otherPage.aspx" id="testFrame" />

$get("testFrame").contentWindow.someTestFunctionDeclaredInThePage();

If this throws an error then the JavaScript cross-site scripting policy is in effect in your case and autosizing cannot work as it cannot access the content page.

You can try adding a simple script at the beginning of each page that will unify the domains to document.domain = "myLastDomain.com"; (i.e. remove the subdomains if they are present).

More information about cross-domain scripting and configuring domains is available here: http://madskristensen.net/post/Iframe-cross-domain-JavaScript-calls.aspx.

Greetings,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Bjorn Sagbakken
Top achievements
Rank 1
answered on 01 Jun 2012, 12:39 PM
Hello Marin

Thanks for the answer. I have already tried with an iframe, and get "Access is denied", so the issue is obviously cross-domain scripting.
I hope your tip on unifying the domains will work. Nice trick. I will try it out and post the result back here.


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