473,378 Members | 1,134 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,378 software developers and data experts.

Where to Call RegisterArrayDeclaration in Composite Server Control?

I am authoring a composite server control (inheriting from
System.Web.UI.Control) that uses a good chunk of client side javascript. To
make this work I need to call RegisterArrayDeclaration and in a manner
simmilar to the following:

Page.RegisterArrayDeclaration(
dataObjectArrayName,
string.Format(
"{{ spanID:'{0}', calendarID:'{1}' }}",
spanID,
calendarID));

Where SpanID and CalendarID are the ClientID values of two controls added
when overriding Control.CreateChildControls. Normally one would call
RegisterArrayDeclaration() in OnLoad, but this occurrs before
CreateChildControls and the ClientID values would not be available at that
point. (I am presuming that the ClientID becomes available once the span
and calendar controls are added to my composite control's controls
collection, correct?). So my question is where can I call
RegisterArrayDeclaration? Can I call it any time prior to rendering (such
as in OnPreRender?).

I also need to call RegisterStartupScript and RegisterClientScriptBlock as
well, though these I can still call in OnLoad since they do not need the
ClientID values of the child controls. Yet I am currious as to whereelse I
may be able to safely call these methods as well.

--Ken
Nov 19 '05 #1
0 1215

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

Similar topics

0
by: luca | last post by:
Hi all. My problem is that I can't handle events raised from child components within a composite server control when the control is created dynamically. Everything works fine if the same control...
10
by: dx | last post by:
I have the Microsoft Press: Developing Microsoft ASP.NET Server Controls and Components book. It's starting to shine some light on control development but there is something about composite...
2
by: Mark Goldin | last post by:
I am trying to create my first composite control. Here is the code: using System; using System.Collections; using System.ComponentModel;
3
by: Martin | last post by:
Hi, I have created a composite control that has a number of standard asp.net controls on it that can themselves cause postbacks. What i need to do in my composite control is to determine which...
4
by: Mark Olbert | last post by:
This involves a family of related, databound ASPNET2 composite controls. I've managed to arrange things so that the composite controls restore themselves from ViewState on postback after they're...
3
by: Eric | last post by:
I have created a fairly basic composite control consisting of a Label and a TextBox. In the overridden Render function, I'm creating a table with two rows and each row contains a cell (td). The...
2
by: =?Utf-8?B?Qw==?= | last post by:
Hi, I have a 3 dimenionsal array which I populate in my C# code. I then want to make this available to my Javascript so I do below. Page.ClientScript.RegisterArrayDeclaration("myArray",...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.