views:

159

answers:

2

After some research, it is my understanding that this is not possible. I can use query strings to pass information, but that requires reloading the page. I can use web services too, but I'd rather avoid that if possible. At this point, I don't care about being able to do it or not, but I'd like to know WHY I can't do it. It seems like I should be able to call it's public functions like any other object.

+5  A: 

It's not possible, because the silverlight's code behind is not server code, it's client code.

The server code and client code doesn't exist in the same place, and they don't exist at the same time.

Guffa
Zactly. Silverlight apps have more in common with WinForms apps than they do with ASP.NET apps. The web is purely the delivery mechanism for Silverlight, the code is running at the client.
Dave Swersky
A: 

You might want to explain more of what you're trying to accomplish than how you're trying to accomplish it. For instance, you can maintain a duplex connection between client and server, allowing you to "push" information down from your ASP.NET application to your Silverlight object. There are a lot of other lightweight alternatives that don't require a full-featured webservice.

Why do you like to be able to call Silverlight methods from your ASP.NET code?

Jon Galloway