What is the equivalent to IScriptControl for Web.UI.Page?
        Posted  
        
            by Jeff Dege
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Jeff Dege
        
        
        
        Published on 2010-04-01T20:04:41Z
        Indexed on 
            2010/04/02
            12:03 UTC
        
        
        Read the original article
        Hit count: 365
        
ASP.NET
|iscriptcontrol
We've been using IScriptControl to tie javascript objects to our UserControls and ServerControls, and it's worked fine.
The problem is that ASP.NET seems to provide no method to tie a javascript object to a Page. Up to now, we've been putting plain functions in the global namespace, but I am developing a serious allergy to that practice.
It'd be easy enough to wrap our functions into a javascript class, and to include the javascript file on the page, but how to instantiate the object, how to reference it from callback events, and how to pass data to it from the code-behind, I haven't figured out.
Or rather, the methods we've been using up to now (hidden fields, emitted javascript strings, etc.), really bug me.
Anyone have better ideas?
© Stack Overflow or respective owner