Last post Feb 12, 2009 05:50 PM by boranin
Jul 03, 2007 11:46 AM|larsxe|LINK
I have developed a WebControl that essentially displays a header text by loading a Flash movie in HTML, passing some parameters (like the header text) from the WebControl to the movie.
Due to issues with Adobe Flash Player and Internet Explorer when rendering Flash content inside <form> tags, and rendering multiple movies on the same page, I have been forced to display the Flash content inside an <iframe>. The WebControl writes out the
<iframe> tag, with a src attribute set to the HttpHandler address, which in turn writes out the necessary HTML to render the Flash movie.
So, given this, is it possible to do something like GetWebResourceUrl from the HttpHandler class?
Http Handlers ClientScriptManager GetWebResourceUrl
Jul 06, 2007 01:07 PM|larsxe|LINK
Is it perhaps possible to use Reflection together with a HttpHandler, and somewhat replicate what GetWebResourceUrl does?
Jul 07, 2007 10:27 AM|Bravo9|LINK
You need to add the .swf file to your project and set its "Build Action" to "Embedded Resource". This step is very important and you need to make sure to do it or it will not work.
Next you need to reference the embedded resource with an assembly level attribute, named WebResource. From there it simply requires a call to the GetWebResourceUrl method. The only tricky part in any of this is that the path for the underlying .swf file
my be qualified with the assembly name and any directories that it is contained in.
[assembly: WebResource("MyAssembly.MyFolder.MySubFolder.MyFile.swf", "application/x-shockwave-flash")]
public class TestPage : Page
protected override void OnInit(EventArgs e)
string url = Page.ClientScript.GetWebResourceUrl(GetType(), "MyAssembly.MyFolder.MySubFolder.MyFile.swf");
Feb 12, 2009 05:50 PM|boranin|LINK
The real question here is how to access resource from class implementing IHttpHandler. My understanding is that Page object is no accessible there in this context (Page.ClientScript...). The best solution would be getting the refference only (URL to WebResource.axsd).
Example would be serving content of the IFrame from web server control, where images (part of the served content) are embeded in the dll web server control sits in.