views:

200

answers:

1

Hello everyone,

I am using VSTS 2008 + .Net 3.5 + C# + Silverlight 3.0. I am developing a Silverlight xap application. And I want to allow 3rd party web sites to reference my xap file, for example, 3rd party web site could use an iframe to reference my xap application directly from my IIS 7.0 web server, and using such iframe to embed my xap application in their pages to make end user think my xap file is a part of their page (just like Google Ads is showed in some web pages).

I want to track which 3rd party is referencing my xap Silverlight application for each request. Any solutions?

thanks in advance, George

+1  A: 

You could have your XAP perform quick post via WebClient to your site when it loads.

AnthonyWJones
I am not sure whether your solution could solve my issue. The xap file is hosted in/from my site, and a 3rd party site will include/reference my xap file in iframe. In this scenario, I think since xap file is always loaded from my site (i.e. xap file will always be downloaded from my site when client browse the 3rd party site), invoking quick post via WebClient will always find the xap file is loaded from my own site? Please correct me if I am wrong.
George2
Well that is a good point. Is the IFrame served from you site as well? If not then you could try accessing the `DocumentUri` property (`HtmlPage.Document.DocumentUri`) in the Xap and post that back.
AnthonyWJones
"Is the IFrame served from you site as well" -- in the 3rd party web site, they will use an iframe in their page to include my xap file, not sure whether it means served from my site?
George2
Hmm... not sure communicating here. There is no need to host a XAP in a IFrame. One places HTML content in an IFrame. I guess you probably mean some HTML which in turn contains an object tag for the silvelright control. So I guess the question is where does the HTML in the IFrame come from, your site or theirs?
AnthonyWJones
Thanks! In my scenario it is like this, I wrote xap file and I develop an html page to include the xap (the html page is almost the same as the html page generated by VSTS 2008 for a Siverlight project). Some other web site will design web page, and in a part of web page they will use iframe and set the src of iframe to point to my html file. Any solutions in my scenario to track which 3rd party web site is referring my xap (html) file?
George2
I want to know which 3rd party web site is referring my html page using an iframe in their page.
George2
The only way I know of is to have a look at the Referer header that may be included in the request to your HTML content. Unfortunately some browsers (I'm thinking FF specifically) do suppress the referer header in this scenario.
AnthonyWJones
How about let the 3rd party site to host the xap file and use the HtmlPage.Document.DocumentUri property as you mentioned? Is that a feasible solution?
George2