简体   繁体   中英

Calling a function in silverlight's code behind from an aspx code behind

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.

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM