RegisterClientScriptBlock not working from server control. Help?

B

Big Dave

Good morning. I'm trying to register a client script block from a
server control. I've put the line of code to register it in the render
method, the onprerender event, I've overridden the pre-render method,
the controls init event, everything, but I still can't get it to work.
When I debug, I can step through to that line, but it's still not
outputting the javascript. Oh, and there is a form tag on the main
page. Any ideas on what else I can try to get this thing to work?

Just for an FYI, the custom control is added to a user control, then
that user control is added to a template user control, which is finally
added to the page.

Private Sub NavigationBlock_PreRender(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.PreRender
If Not Page.IsClientScriptBlockRegistered("navArray") Then
Page.RegisterClientScriptBlock("navArray",
Me._scriptArray.ToString)
End If
End Sub

Big Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top