473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

RegisterClientScriptBlock not working from server control. Help?

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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
0 1237

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark | last post by:
I've been reading the following link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html /aspnet-injectclientsidesc.asp That supposedly tells you how to use these:...
1
by: Mark | last post by:
I'm really pulling my hair out on this. (newbie at ASP.NET) I have a control (called 'header.ascx' ) that I want to place a DHTML(javascript) menu in. I keep getting errors. The menu code is...
2
by: Earl Teigrob | last post by:
I have a Web Custom Control that builds javascript to write to the page. The DatePickerJs() function builds over 500 lines of javacript code. Even thought my Custom Web Control does not write it to...
2
by: sam | last post by:
I am trying to emit script to the response stream within the Application_Error handler in global.asax. I want to emit using Page.RegisterClientScriptBlock. This doesn't work, and I have been...
1
by: Simon Harris | last post by:
Hi All, I'm trying to write a composite web control which will render a rich text editor. I am having problems with RegisterClientScriptBlock - The script simply doesnt get written. There are...
9
by: Nathan Sokalski | last post by:
I have used the RegisterClientScriptBlock method in external functions of mine (ones that are saved in a separate *.vb file), where I use them as follows: Public Shared Sub MyFunction(ByVal...
4
by: Nathan Sokalski | last post by:
I am working on converting my code from ASP.NET 1.1 to ASP.NET 2.0. In ASP.NET 1.1 the RegisterClientScriptBlock method was just a key and script (2 Strings), but in ASP.NET the...
2
by: Alex Maghen | last post by:
Hi. Two questions about "RegisterClientScriptBlock": 1. I want to be able to insert a script block without having to worry about whether the "key" is unique. As it turns out, if a script block...
5
by: Pselus | last post by:
I have a dynamically created page. The page creates an UpdatePanel (created at Design time) which has an ASP:Table (design time) in it. The table has rows with a textbox (run time) that runs some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.