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
 
Joined
Apr 20, 2011
Messages
1
Reaction score
0
Hello Big Dave,

I just run into your old post. I om heving the same problem as you describe. Have you ever found the solution?

Thanks!
Bas
 

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

Top