简体   繁体   中英

Can I call JScript functions or access JScript objects via DLR on the server side (ASP.Net)?

Is there a way to call JScript functions or access JScript objects via DLR on the server side (ASP.Net)?

This question is driven by the fact that there existed a way to call JScript from within Silverlight apps by the DLR. - Mr. Hejlsberg showed it on pdc '08 via DLR and the JavaScript-Binder here . I didn't find any concrete information on that feature being present for ASP.Net; I even read that the binder was abandoned by Microsoft. - So I hope to get some information here.

You CAN create JavaScript functions and register them on the server side, you CAN access those scripts, but (forgive me if I'm stating something that you already know, but just in case you don't know...) you CAN'T make the browser call the scripts whenever you want via the server (well, at least, with normal ways). A request is made, and a response is sent, and that's it. There is no logical ongoing connection between the browser and the server, and that's not possible, if that's what you wanted. Perhaps you may want to provide a simple example so we can help further.

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