Putting a link to a flash object swf in a asp.net MasterPage - master-pages

I have a asp.net master page that gets used by pages many /levels/deep/
I will put a link to a flash file in this template.
I tried doing it like this but it did not work, what the best practice here?
<object width="924" height="200">
<param name="movie" value="/live.swf">
<embed src="/live.swf" width="924" height="200">
</object>

If you using .net and putting an swf into a master.page, use this:
<script type="text/javascript">
swfobject.embedSWF("<%= this.ResolveUrl("~/live.swf") %>", "headerFlash", "924", "200", "9.0.0");
</script>

Related

Browse Another Website Inside MVC Application

I have an existing web application which I want to display inside my new application, so as to the complete application works inside the new application.
In the image i've attached google.com so on search of something is should show the result or even open the website.
I'm not sure how to achieve that.
One way I found is IFrame, so would I to know any other possibilities are their as I do want to use IFrame
Attaching an Image for an example
Thanks in advance.
Maybe you can use something like fancybox tools. http://fancyapps.com/fancybox/#examples
But usually these tools are also using iframes. Maybe you can find another way for fancybox.
edit:Embed an External Page Without an Iframe?
edit 2: did you try this?
http://www.felgall.com/noiframe.htm
<html>
<head>
<title>example</title>
</head>
<body>
Ilker Test
<br />
<!--[if lte IE 6]>
<object classid="CLSID:25336920-03F9-11CF-8FD0-00AA00686F13"
data="http://www.w3schools.com/html/html_examples.asp" style="height:800px; width:1200px; overflow:hidden;">
</object>
<![endif]-->
<!--[if gte IE 7]><!-->
<object type="text/html" data="http://www.w3schools.com/html/html_examples.asp"
style="height:800px; width:1200px;">
<p>Alternate text.</p>
</object>
<!--><![endif]-->
</object>
</body>

PDF is not display in safari i-Pad

Inside my asp.net MVC web application i need to display pdf in safari browser in iPad. my code is like this.
<object data="#Model.StringPdfUrl" type="application/pdf">
<embed src="#Model.StringPdfUrl" type="application/pdf" />
</object>
Does anybody know about the fix for this issue.
Thank you in advanced
I wonder if this is not the same issue I once had with Internet Explorer.
Even with the latest IE 11, if the url doesn't end with the extension .pdf (which was the case with my MVC app: the url was like /File/Download/4587), then IE plug-in could not render the PDF file. Same issue with <embed>.
I tried the iframe solution, but on some computers the document opened up in a new window.
In the end, the solution I implemented was to convert each page of the PDF document into an image with GhostscriptSharp, and then to render the document online as images in an HTML page (with navigation controls to go to first/previous/next/last page).
I Found a solution.
I used iframe to render pdf in safari
if (Request.Browser.Type.Contains("Safari"))
{
<iframe src="#Model.StringPdfUrl" height="750" width="600" frameborder="0" id="myiframe" ></iframe>
}
else
{
<object height="750" width="600" data="#Model.StringPdfUrl" type="application/pdf">
<embed src="#Model.StringPdfUrl" type="application/pdf" />
</object>
}

Whats the best way to embed a flash file from a link?

I have looked around, but still have not found a very good answer to my question.
I would like to know how I can embed a flash game into my website Via HTML or Java in order for it to play.
I have the SWF file, but am unable to put the file on the site, so I got this link "https://dl-web.dropbox.com/get/flight.swf?w=AAAYS8vwABuIJB3QbyhV1kSX778W0mXh4xRoQ0ADqm4w6g" that is JUST the flash game
Whats the best way to insert this into my site?
Below is a general script which will embed your flash movie in a html page, theres several ways to do this but below will work just copy and paste the code on to your html page in the body area.Check the adobe website if you need other parameters or more information.
<object id="yourmovie.swf" width="550" height="450" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" align="middle" bgcolor="#ffffff">
<param name="allowScriptAccess" value="sameDomain" />
<param name="quality" value="high" />
<param name="src" value="http://www.yourwebsite/yourmovie.swf" />
<param name="allowscriptaccess" value="sameDomain" />
<param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
<embed id="slots.swf" width="476" height="321" type="application/x-shockwave-flash"src="http://www.yourwebsite/yourmovie.swf"
allowScriptAccess="sameDomain" quality="high" allowscriptaccess="sameDomain"
pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" bgcolor="#ffffff" />
</object>
To use a link from java my option will be create a button/link thats open another window with the above on that html page

Silverlight app works in aspx page, not MVC Razor View

I'm having trouble getting my Silverlight app to show in an MVC3 Razor View.
When I add the application and it generates the test page (TestAppTestPage.aspx in my case), I can browse to the page and the app works fine. If I copy the same code to an MVC Razor view, then browse to the controller action, nothing happens with the application:
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/TestApp.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="5.0.61118.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
If I look at the developer console for Chrome, the only thing I see different is the following warning: "Resource interpreted as Other but transferred with MIME type undefined". I'm not sure if this is related.
I've looked at various guides on Silverlight and MVC, and copying relevant portions of their code produces no results either. I've played with adjusting the path, using relative urls, nothing. I've also checked IIS settings, but because it works fine in the aspx test page, I suspect that's not the cause.
Based on mfanto's comment, turning my comment into an answer.
Was guessing in my comment, but I've had issues when NOT using Url.Content for any external files. So the fix would be to use something like
<param name="source" value="<%= Url.Content("~/ClientBin/TestApp.xap") %>" />
Note that that is from an MVC 2 app.

Silverlight Host App only showing loading image

Im attempting to use Silverlight and MVC together. After creating a simple Silverlight application I attempted to view it using the MVC host application (using the provided aspx and html pages). The issue is that when I view the page all I see is the Loading image (with a 100% value) and that is all. It never displays my app!
Here is the html for the aspx page:
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/MVCSilverlight.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>
And here is the xaml for the application:
<UserControl x:Class="MVCSilverlight.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
mc:Ignorable="d"
d:DesignHeight="500" d:DesignWidth="500">
<Canvas x:Name="LayoutRoot" Background="Crimson">
<TextBlock Text="Hello World" ></TextBlock>
</Canvas>
</UserControl>
Everything else in the application is standard code (code that was generated when I created the project). Has someone seen this issue before? Is there something that I'm missing? I'm very new to both technologies to any info will be very helpful.
When you run the app check that VS has attached to the browser process for Silverlight debugging (not Script).
Also check your App.xaml.cs contains:-
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
}
The loading splash screen will remain in place whilst the RootVisual remains unset. So either the code just doesn't set it or an error is occuring (and for some reason your not being alerted of the error) so that code never reaches the assignment of RootVisual.
Also get yourself a the free HTTP debugging tool called Fiddler so you can trace all the actual HTTP conversations, perhaps the xap isn't being downloaded at all for some reason. In fact that would be my guess, the MVC routing might be doing something undesirable with "ClientBin/MVCSilverlight.xap".

Resources