This is a migrated thread and some comments may be shown as answers.

use Silverlight Controls with asp.net 2.0?

8 Answers 108 Views
Installer and Visual Studio Extensions
This is a migrated thread and some comments may be shown as answers.
Kevin Woram
Top achievements
Rank 1
Kevin Woram asked on 05 Jan 2010, 05:29 PM
Our product is an ASP.NET 2.0 website.  I have already implemented and deployed a Silverlight 3 control for capturing user signatures into our product.  I am currently evaluating the Telerik Silverlight RadScheduler control but I am having trouble gettting the Silverlight Control Examples to work with .NET 2.0.  Is .NET 3.5 required?

8 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 06 Jan 2010, 08:27 AM
Hi Kevin,

Yes, RadControls for Silverlight require .NET Framework 3.5. You would need to install Silverlight Tools and .NET Ria Services as well.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kevin Woram
Top achievements
Rank 1
answered on 06 Jan 2010, 02:54 PM
Thanks Erjan, I now have a Silverlight RadControls project running in my VS 2008 solution.  Our product is a web application that targets ASP.NET 2.0.  Can I deploy my Silverlight RadControls project to a web application that targets ASP.NET 2.0?
0
Erjan Gavalji
Telerik team
answered on 06 Jan 2010, 03:43 PM
Hi Kevin,

Yes, basically there is no problem to use a Silverlight application in a website, targeting .NET 2.0.
You would only need to set up the object tag correctly.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kevin Woram
Top achievements
Rank 1
answered on 06 Jan 2010, 03:54 PM
Thanks again, I am glad to hear that.  I wonder if you could point me in the right direction on a problem I am having.   To get Appointment data from our website into the Silverlight RadScheduler, I am trying to make my Silverlight RadScheduler app communicate with a web service on our ASP.NET 2.0 website.  I have added a Service Reference to my Silverlight project for the web service on our ASP.NET 2.0 website and I have have written the following code in the Silverlight app to make a call to the web service method 'Initialize()':

SilverlightRadScheduler.com.auditmatic.services.

ServiceBrokerSoapClient soapClient =

 

 

new SilverlightRadScheduler.com.auditmatic.services.ServiceBrokerSoapClient();

 

 

soapClient.InitializeCompleted +=

new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(soapClient_InitializeCompleted);

 

soapClient.InitializeAsync(

"testing");

When I try to debug my Silverlight app, I get this warning:

The Silverlight project you are about to debug uses web services.  Calls to the web service will fail unless the Silverlight project is hosted in and launched from the same web project that contains the web services.  Do you want to debug anyway?

The Silverlight app is in the same solution as the web project that contains the web services, so I assume this will not be a problem.  However, the InitializeAsync call fails with the following error:

An error occurred while trying to make a request to URI 'http://localhost/AuditmaticMgr.UI/Service/ServiceBroker.asmx'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

I have tried deploying crossdomain.xml and clientaccesspolicy.xml files to the root of my ASP.NET 2.0 website as advised here:

http://forums.silverlight.net/forums/t/43293.aspx

But I continue to get this error.  Can you give me any insight into this problem?

Thanks.

 

0
Erjan Gavalji
Telerik team
answered on 06 Jan 2010, 04:21 PM
Hi Kevin,

This is a common limitation due to the cross domain call restriction of Silverlight. A workaround is to host a wrapper webservice in the web application, which in turn makes calls to the external webservice.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kevin Woram
Top achievements
Rank 1
answered on 06 Jan 2010, 06:01 PM
OK, I am past the previously-reported problem and now enountering this problem: 

I am trying to create a web service method in my ASP.NET 2.0 website that my RadScheduler Silverlight app can call to retrieve appointment data.  If I declare my web service method to return a colleciton of Telerik.Windows.Controls.Scheduler.Appointment objects, I get a compliation error:

Error 114 The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\Development\AuditMatic.root\AuditMatic\AuditmaticMgr.UI\Service\SilverlightBroker.asmx.cs 20 30 AuditmaticMgr.UI

This is because the base class of Appointment (AppointmentBase) implements the INotifyPropertyChanged method, which is specific to the .NET 3.5 framework:

 

AppointmentBase

 

: IAppointment, IDateSpan, INotifyPropertyChanged

I cannot add the 3.5 assembly that defines INotifyPropertyChanged to my ASP.NET 2.0 web application.

Furthermore, if I try to modify the method to return a serializable object defined in my web solution, I cannot import the reference to that serializable object into my Silverlight App. 

Do you have any suggestions on how  to solve this problem?

 

0
Erjan Gavalji
Telerik team
answered on 07 Jan 2010, 08:00 AM
Hi Kevin,

Yes, that's correct, to utilize the Appointment objects, the data transport mechanism would need to refer to .NET Framework 3.5.
The workaround is to change the webservice. The data, returned by the webservice would need be of some custom type, which would in turn be converted to Appointment objects in the Silverlight Application.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kevin Woram
Top achievements
Rank 1
answered on 07 Jan 2010, 01:24 PM
Thanks.  I have implemented this work-around.
Tags
Installer and Visual Studio Extensions
Asked by
Kevin Woram
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Kevin Woram
Top achievements
Rank 1
Share this question
or