ASP.NET and Silverlight applications - asp.net

I am new to Silverlight, so this question might seem pretty stupid. My question is, can an ASP.NET web application that's hosting a Silverlight application receive events generated by the Silverlight application? If not, how does an ASP.NET application communicate with a silverlight application?

You have essentially two wide-open paths for communication. First, Silverlight is dependent on services for data, and makes effective use of ASP.NET web services. Second, Silverlight is fully enabled for browser integration, including javascript between Silverlight and the HTML markup. So anything that Silverlight tells Javascript, or vice versa, is available to the web app in ASP.NET.
Edited to add:Also coming, and in beta now, is WCF RIA Services, which is full integration between ASP.NET and Silverlight. Service calls from Silverlight are seemlessly integrated with server code in ASP.NET.

Silverlight and ASP.NET are in different processes, and are most often on different computers. As such there is no direct linkage between the events which occur in both types of applications. Most people use Web Services either SOAP or REST to communicate.
You might use an event in the Silverlight to trigger a call to an ASP.NET web service or WCF service.

Related

Host ASP.NET App In WCF or Generic Web Server

Objective:
We have a Windows Service/generic EXE that also hosts a WCF service (.Net 3.5). I'd like to be able to take a third party ASP.NET component in a DLL, and host it through that WCF Service.
Is this possible to do, in any way?
It seems like if you want to host a ASP.NET app, it must be through IIS, but we don't use IIS.
Is there any way that we could load the ASP.NET app into memory, make the app available through an endpoint, and receive requests back from the app?
Specifically, we'd like to take the "Microsoft.ReportViewer.WebForms.dll", expose the web form in a web page, and accept any requests back from the web form.
http://msdn.microsoft.com/en-us/library/ms251723.aspx
Looking for anything to get me started. Thx.
From owin.org
"OWIN defines a standard interface between .NET web servers and web applications. The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools."
Essentially Owin implementations, like Katana (OWIN implementations for Microsoft servers and frameworks.), help you self host web apps, even in a Windows NT Service.
According to this post, hosting a WebForms app outside IIS/ASP.NET is not possible.
WebForms are tightly coupled to ASP.NET/IIS and cannot run directly on
OWIN/Katana (e.g. outside of ASP.NET/IIS). However, you should be able
to use Katana's middleware (Security, CORS, etc.) in a WebForms
application.
http://katanaproject.codeplex.com/discussions/571291

can i use wcf rest service in my asp.net 3.5 web application

I heard that rest services are moved from wcf to asp.net web api frame work.
Our web application is built on vs 2010 (asp.Net 3.5) .So still i can use wcf rest services in my web application?
Please suggest some alternatives if it is not possible.
WCF can still be used to build RESTful services1, many services are already built with it and it's not going away. What you heard is that most of the new developments in terms of new functionality in the area by Microsoft will be made in the ASP.NET Web API framework, not in WCF. But as all the services out there can attest, WCF for building web services is still a valid alternative, if it does all you need.
1 The official name is actually "WCF Web HTTP Services"; REST is a well-defined set of constraints which need to be implemented, which would give the service some useful properties. There are some people who argue that people should stop using the term REST for all HTTP-based, non-SOAP services.

Silverlight and RIA Service without ASP.NET

I'm pretty new to Silverlight/RIA/Asp.Net thing, and I'm trying to figure if an Asp.Net website is required (for hosting the app) if I wish to use RIA services with Silverlight?
You could use a Web Application for hosing the RIA services in which is a compiled version of a Web Site. This is a distinction made by Visual Studio for different types of web projects but that might not be what you mean.
Really though RIA is just web service that takes a certain set of parameters. You technically could use PHP and generate the same content although that seems like it might be a bit of work unless there are frameworks that already do this.
Your RIA service will need to live somewhere online though. You don't need a website with web pages but you will need to run the service in a web server like IIS and that means it probably needs to live in a web site, even if the website doesn't have any web pages.
No, you can not use RIA services without an ASP.NET application. While it is true that you can create the backend data service with PHP (or a number of other web technologies), that would not be making use of RIA services.
The basic idea of RIA services is to provide a super simply means of plumbing your data classes through ASP.NET. Mostly it is used in conjunction with an ORM and additional metadata classes in your web application. You then provide a service to manipulate your data. When you compile the solution than the work you did in the web project gets pushed into your Silverlight application (through code generation).

what is the difference between webservice and webapplication?

can you please tell me what is the difference between webservice and webapplication.
A web service:
Typically returns XML or JSON or something like that, something that is easily decoded by a program
The results you get from a web service is typically not just shown to a person in its raw form (ie. since it isn't HTML, the results have to be reformatted, like placed into a form)
The intended usage of a web service is that it is something an application can talk to
A web application
Typically returns HTML or image data or similar
The results you get from a web application is usually shown to a person, through a web browser
As for similarities:
Both typically use HTTP(S) as the transport
Both typically use HTTP authentication/authorization to secure data
Both are typically hosted by a web server
So the main difference is who usually talks to them. A web service usually by another application, a web application usually by a web browser. Other than that they're pretty similar.
Here is the Web Application and here is Web Service
Web application: any application which resides on a server, and mainly used by human using web browser. All user interactivity is done through web pages.
Web service: server-based application (as above) which may be accessed over the web via HTTP, but is meant primarily for interaction with other programs. Generally it is WEB API for other applications.
In a nutshell, a Webservice uses special HTTP transport protocols to communicate to other servers. Webservices are meant to be used by other applications.
In the ASP.Net world, a web application is a type of Visual Studio project that allows building ASP.Net websites in a particular configuration. E.g. A Webservice can be built using a Web Application type project. Or a Web Application can also refer to a website that is meant to be used directly by an end-user ( unlike web services ).
Here are a few links and related SO questions...
What is the difference between an asp.net web method and a wcf service?
ASP.NET Web Site or ASP.NET Web Application?
Introduction to Web Services and ASP.NET
check this
http://en.wikipedia.org/wiki/Web_service
http://www.w3schools.com/webservices/ws_intro.asp

Silverlight vs asp.net

Can any one tell me if i want to learn silverlight is it neceesary to have some knowledge of asp.net?
Thanks in advance
First of all its not silverlight vs asp.net. Those two are entirely different.
Silverlight is a cross-browser,
cross-platform implementation of the
.NET Framework for building Rich
Interactive Applications(RIA) for the
web.They execute from the web browser itself.
You can use any server side technology along with silverlight.
See
Server-side scripting
Silverlight is a client-side technology that talks to services - web services, WS-*, WCF, RSS, Restful interfaces, etc. It has no dependencies on any specific server technology. Silverlight also has a JavaScript bridge, so it can use JavaScript to communicate with other components of a web page.
On the other hand, Silverlight is a client-side implementation of .NET's run-time and a subset of the .NET framework, so as you learn Silverlight, there is some positive knowledge transfer between .NET server-side and Silverlight development.

Resources