开发者

ASP.NET MVC - SWF files not loading

开发者 https://www.devze.com 2022-12-13 09:31 出处:网络
In my asp.net mvc site, I\'m loading flash files using swfobject.These files work fine, locally, using Visual Studio 2008 server (F5).But, when deployed to the T开发者_Go百科est server, they don\'t lo

In my asp.net mvc site, I'm loading flash files using swfobject. These files work fine, locally, using Visual Studio 2008 server (F5). But, when deployed to the T开发者_Go百科est server, they don't load at all. My routing table looks like this:

routes.MapRoute(
    "Default",
    "{controller}.aspx/{action}/{id}/{title}",
    new {controller = "Home", action = "Index",id = "",title=""});
routes.MapRoute(
   "Root",
   "",
   new {controller = "Home",action = "Index",id = "",title = ""});

And I'm loading the swfs like:

<div id="home-container">
    <div id="flash-content" style="outline:none;position:absolute; top:0px">
        <h1>GET THE LATEST FLASH PLAYER TO VIEW THIS SITE.</h1>
        <a href="http://www.adobe.com/go/getflashplayer">
            get it now
        </a>
    </div>        
</div> 
<script type="text/javascript">
    // Embed the SWF
    var flashvars = {}; 
    var attributes = {id: "whole-grains-home", name: "whole-grains-home", style:"outline:none;"};
    var params = { allowscriptaccess: "always", menu: "false", wmode: "transparent", swliveconnect: "true" };
    var flashFile = '<%= Url.Content("~/files/flash/Homepage/R9IN03_PostH&W_Homepage.swf") %>';
    swfobject.embedSWF(flashFile, "flash-content", "990", "538", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>

I'm suspecting that root route is to blame, but I just can't figure out why this works locally, but not on the server.

Anyone have any ideas?

Thanks.


I noticed that one of my files did work. I then looked at that file, as compared to the others and noticed that the ones that did NOT work had "&" in their filename (like the example above).

Taking that out seems to have solved this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消