I created an asp.net application. How can I integrate a silverlight tag to my asp.net project. When i googled I got some of the examples for 2.0 . Where can I get an example solution for silverlight 3.0?
Note : when I searched for the same in google, i got a solution to add a system.web.silverlight.dll that is present in my %win%/Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Server\system.web.silverlight.dll
for 3.0 %win%/Program Files\Microsoft SDKs\Silverlight\v3.0\Libraries\Server\System.ServiceModel.PollingDuplex.dll is there no system.web.silverlight.dll .
What i need to do, to integrate the silverlight into my asp.net?
You don't want to add those assemblies to your asp.net website as they are for development of the Silverlight project.
All you need is:
Silverlight 3 plug-in the user's machine
a XAP file which is the compiled Silverlight 3 binary
Latest Silverlight.js
Some markup in your html or aspx page like example below (ClientBin/BIA1.XAP is the binary used)
It's much easier to just install the Silverlight Tools for VS2008 and let set it up for you by adding a New Silverlight project to your solution, it will ask you if you want to integrated to your existing asp.net website with a test html file created. Download here
<object data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/BIA1.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
Related
same log4net appender azure nuget code working fine for console app,
but not working in MVC application.
I'm using this nuget log4net.Appender.Azure 1.1.1
already added log4net.Config.XmlConfigurator.Configure();
in Global.asax
web.config
<log4net>
<!-- Azure Table Appender, uncomment, set proper QueueName and AWS credentials (appSettings) to try it out -->
<appender name="AzureAppender1" type="log4net.Appender.AzureTableAppender, log4net.Appender.Azure">
<param name="TableName" value="test" />
<param name="ConnectionString" value="***" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
Can anyone know why it is not working ?
I am not sure - but I would be a little careful about using Tables for large scale logging scenarios. Take a look at the logging anti-pattern in this Table Design Guide. It can often lead to hot partitions - and often times the scenario is much better supported using Blobs.
Here we go I found that it is problem od log4net dll version.
in nuget log4net appender azure version of log4net dll is 1.2.12 it is the older one. need should be updated to newer version 1.2.13
that solves the above issue.
I have spent many hours researching how to display an RTSP feed in a web page. I've tried Quicktime (400 bad request), VLC (No plugin to display this content) and Windows Media Player (protocol not supported). I've read many posts and pages tried variations of code in the web page and also looked at streaming servers, but to be honest, I was hoping it wouldn't be that complicated as I would need somewhere to host the server.
In can open the stream in VLC so was surprised when the plugin didn't work. This is the code in the page but the result is (No plugin to display this content) the browser doesn't even ask to download a plugin.
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
width="640" height="480" id="vlc" events="True">
<param name="Src" value="rtsp://belletout.no-ip.biz:1552/live3.sdp" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed id="vlcEmb" type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"
target="rtsp://belletout.no-ip.biz:1552/live3.sdp" ></embed>
</OBJECT>
I am really surprised that there isn't an easier method to do this unless I am just following examples that aren't appropriate.
Can anyone offer any suggestion as how to display this real RTSP stream from above in a web page? I would be most grateful.
Thanks
Rob
You need a live media encoder that can read the webcam feed and than encode it.
try windows media encoder Windows Media Encoder 9
change your webpage code to use windows media player.
There should be a sample when you install it.
My SL app shows correctly in all browsers (Opera, FF, IE) in all web servers (embedded, IIS 7.5) on my develompment machine. But in work web server (IIS 7.5) no one browser show my SL app. No error, nothing - just empty place. But it contains all markup of my SL app:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="200px" height="40px">
<param name="source" value="#Url.Content("~/Apps/SilverlightApplication1.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>
In addition, on my development machine I have the "Setup SL app on this PC..." button in SL context menu, but not on my work server.
All IISs - on development and work server machines - have settings ".NET 4 FW" for app pool .NET version and integrated pipeline.
I can get the .xap file directly through the browser's address bar but can't get one through the HTML page.
It seems that the SL app just is not visible on my work server. How to fix it?
Addition. There is no any Silverlight development or client framework on the work server - can it be clue?
UPDATE. I changed data and type attributes in the object tag to "application/x-silverlight-app". Now the "invite to install SL" image appears instead of my SL app. But I already have the newest version of SL plugin, and while installing the SL the installer tells me about it.
If you are getting just a white screen then you should go into the silverlight.js and make it so the errors are thrown to some sort of message box that you can see.
If it's plain white there is an error of some sort going on, and if debug is essentially turned off in the settings (i.e don't show the user the error) then you'll not know what the issue is.
[EDIT]
Add .xap application/x-silverlight-app as MIME type.
I'd like to see if anyone out there can steer me in the right direction for linking up a Silverlight project with an MVC2 one. I know how to get it started but how do I get the .xap to show in the View? Looking for a good tutorial or blog?
I didn't find a nice blog or tutorial about doing specifically what you're asking, but I did try it out myself.
In VS2010, I created a new project of type Silverlight application. During the process, it asked what type of web project I would like to associate and I selected MVC. This automatically created an MVC2 web application with a ClientBin directory. After building the solution, my ClientBin was populated with the *.xap file. If you need to manually do this part, go to the project properties page of the MVC2 project and then the tab "Silverlight Applications". Click "Add" and select your project. Choose the appropriate settings, which should include, at least, debug support.
In order to include your silverlight *.xap file in a view, you just need to reference the file through HTML. I just copy/pasted the section from the automatically generated test page.
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication1.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.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>
I placed that into my Views/Home/Index.aspx and my silverlight *.xap application worked as expected.
I hope this helps! =)
I want to make a Silverlight application in Expression Blend because of the rich UI and navigation of Blend. But I want to store the Silverlight application in an ASP.NET MVC web project. When I try to make a new Silverlight application, the default web application is an ASP.NET Web application (or web site, if I'm wrong). Can I make a single Silverlight application (no web project) then import in an ASP.NET MVC application? How can I do this?
Yes, you can.
Create your Silverlight application without the web project.
Add asp.net mvc project to the current solution.
Go to the properties of you asp.net mvc project
Select the Silverlight Application tab, click the Add button, and select the Silverlight project in the solution. Also specifiy the destination folder (in the asp.net mvc) where you want to place xap file.
Create the view for you silverlight application.
Reference your silvelight applicatition in the view. For example:
Code:
<object type="application/x-silverlight-2"
data="data:application/x-silverlight,"
width="100%" height="100%">
<param name="source" value="/ClientBin/MySlApp.xap"/>
<param name="onError" value="onSilverlightError" />
</object>
That's it...
Cheers