using properties

J

Jon Paal

the primary use of a custom control is achieved with :

"<cc1:myCustomControl id="CustomControl1" runat="server" />"

properties are assigned programatically with a call to "LoadProperties(CustomControl1)"

Sub LoadProperties(oThis)
othis.Chart_align = "center"
...
End Sub


and this part works.


When I create a second instance of my custom crontrol, and try to access a single function of that control, it tells me the
properties don't exist.

how can I access a single function of my custom server control to return an interim value ?


.............. code start ...

'create a new instance of control
'-----------------------------------
Dim oDisplay as myCustomControl = New myCustomControl
call LoadProperties(oDisplay )

'create new arraylist
'--------------------------
Dim myArrayList As New ArrayList()

'populate arraylist
'-----------------------
myArrayList = oDisplay.buildarraylist()

............. end code .....

This fails because it's not accepting the properties, but it does accept them on the first instance above ??

------------- error msg -----------------
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 1415: writer.AddAttribute("align", Chart_align.ToString() )
 
C

CaffieneRush

Just a shot in the dark but what happens when you pass in the control
to LoadProperties() *by reference*.
 
J

Jon Paal

found my problem, it was in the sequence of properties being passed.

thanks for replying.
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top