Reputation: 16905
I have a webform which contains some LinkButtons.
When each LinkButton is clicked I want to load a different UserControl.
I also want to do it with Ajax.
I tried it in two ways as described here and here
[Both approaches use an UpdatePanel, the first adds the user control and changes its Visible
attribute, the second uses LoadControl
function]
Both works (upvoted them!) but I still have a problem-
I can't run javascripts within the user controls...
It doesn't recognize any function
When the user controls were added not dynamically it all went well
The only workaround I found was to move the javascript from the user control to the page but that's not nice...
Also tried this with no luck
Any help will be appriciated
Upvotes: 0
Views: 1437
Reputation: 22448
For asynchronous requests use ScriptManager.RegisterStartupScript
method
Upvotes: 2