Jquery - add server control
        Posted  
        
            by superexsl
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by superexsl
        
        
        
        Published on 2010-04-10T17:07:53Z
        Indexed on 
            2010/04/10
            17:13 UTC
        
        
        Read the original article
        Hit count: 361
        
Hey,
I'm having trouble with a custom control and adding it dynamically using JQuery. I've got the following code:
$('.custom_control_div').replaceWith(
                "<div><cc:mycustomcontrol id='cControl' ></cc:mycustomcontrol></div>"
);
This doesn't throw any errors, but doesn't work because I need to use runat=server in my custom control. However, if I add runat=server in the code above, no javascript is executed on the page (and jqueryUI no longer works). The custom control works fine when I add it directly to the page from design-time. 
Is there a way to add a control, with runat=server using Jquery?
Thanks
© Stack Overflow or respective owner