A.B.Cade
A.B.Cade

Reputation: 16905

Javascript within a user control in an UpdatePanel not running

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

Answers (1)

IUnknown
IUnknown

Reputation: 22448

For asynchronous requests use ScriptManager.RegisterStartupScript method

Upvotes: 2

Related Questions