Register  Login
Forums

 (you must be logged in to post)

Subject: Cross-browser exception
Prev Next
You are not authorized to post a reply.

Author Messages
SStallingsUser is Offline

Posts:1

08/25/2009 10:42 PM  
Hi Michael --

Thanks for the demo. I followed your steps very carefully, twice, and kept getting a cross-browser error when I ran the module in VS debug mode. From reviewing other forums, it seems a lot of people have this problem. I tried using both and one or the other of the clientaccesspolicy.xml and crossdomain.xml files and never did resolve the problem, I'll try agan later.

But, in the process I learned something else that I'd like feedback on. If it's a good idea, it can be used by others.

As I was working on the cross-browser problem, I eventually realized that the reason the cross-browser situation was occurring in the first place was that VS was running the application at http://localhost:4768/mywebsitefolder/... (note the port number) but the Web service was accessed at http://localhost/mywebsitefolder/DesktopModules/HelloWorld3/WebService.asmx (note there's no port number).

In the demo, the reference to the Web service is set in View.ascx.cs by the following code that does not provide a port number:

string strWebServiceURL
= String.Format(@"http://{0}{1}",
this.PortalAlias.HTTPAlias,
"/DesktopModules/HelloWorld3/WebService.asmx");

I replaced that code with this:

string strWebServiceURL
= String.Format(@"http://{0}{1}/{2}",
this.Context.Request.Url.Authority,
this.Context.Request.ApplicationPath,
"DesktopModules/HelloWorld3/WebService.asmx");

With that code, both the application and Web Service URLs include the port number when running from VS, and neither includes the port number when running directly from IIS, and no cross-browser condition is created.

Do you see any problems with this approach?
Michael Washington (admin)User is Offline

Posts:129


08/26/2009 5:46 AM  
That approach should work. Thanks for the tip.
Michael Washington (admin)User is Offline

Posts:129


08/28/2009 12:12 PM  
I updated the Silverlight 3 Hello World tutorial with the new code. Thanks again.
You are not authorized to post a reply.



ActiveForums 3.7
Terms Of Use | Privacy Statement | Copyright 2007-2008 by Adefwebserver.com Dynnamite DotNetNuke Skins & Modules