473,406 Members | 2,954 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,406 software developers and data experts.

interim values from custom control

I have a custom server control which renders some html.

I want to capture some interim values generated by the control as it processes the data.

is there a way to capture and retrieve the interim values generated by the control, so they can be used elsewhere in the display
page ?

Mar 14 '06 #1
4 1111
Raise an event in your user control, have anyone who cares to hook into the
event and retrieve the event argument.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
I have a custom server control which renders some html.

I want to capture some interim values generated by the control as it
processes the data.

is there a way to capture and retrieve the interim values generated by the
control, so they can be used elsewhere in the display page ?


Mar 14 '06 #2
not sure how to get an event raised for my situation.

the primary use of the 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.
then my weak attempt to get an interim arraylist back from the custom control

.............. 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() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
Raise an event in your user control, have anyone who cares to hook into the event and retrieve the event argument.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message news:Oc**************@TK2MSFTNGP14.phx.gbl...
I have a custom server control which renders some html.

I want to capture some interim values generated by the control as it processes the data.

is there a way to capture and retrieve the interim values generated by the control, so they can be used elsewhere in the display
page ?



Mar 14 '06 #3
you need to define an event in your control, ala:

public event ValueChanged() as CommandEventHandler

have a function that raises it

private sub RaiseValueChanged(newValue as string)
dim args as new CommandEventArgs("ValueChanged", newValue)
RaiseEvent ValueChanged(args)
end sub
you can then hook into the event on the page..

AddHandler othis.ValueChanged, AddressOf(SomeFunction)
sub SomeFunction(source as object, e as CommandEventArgs)
dim newValue as string = e.CommandArgument
end sub
not sure if all that vb.net is right...should give you some ideas...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
not sure how to get an event raised for my situation.

the primary use of the 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.
then my weak attempt to get an interim arraylist back from the custom
control

............. 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() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:ud**************@TK2MSFTNGP10.phx.gbl...
Raise an event in your user control, have anyone who cares to hook into
the event and retrieve the event argument.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:Oc**************@TK2MSFTNGP14.phx.gbl...
I have a custom server control which renders some html.

I want to capture some interim values generated by the control as it
processes the data.

is there a way to capture and retrieve the interim values generated by
the control, so they can be used elsewhere in the display page ?




Mar 14 '06 #4
thanks for trying to help me.

I must be very thick, or I must be stating my question all wrong, because this doesn't seem applicable. I can't see any way to
implement this.

I'll try to rethink/restate my problem and do another posting.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:O8*************@TK2MSFTNGP12.phx.gbl...
you need to define an event in your control, ala:

public event ValueChanged() as CommandEventHandler

have a function that raises it

private sub RaiseValueChanged(newValue as string)
dim args as new CommandEventArgs("ValueChanged", newValue)
RaiseEvent ValueChanged(args)
end sub
you can then hook into the event on the page..

AddHandler othis.ValueChanged, AddressOf(SomeFunction)
sub SomeFunction(source as object, e as CommandEventArgs)
dim newValue as string = e.CommandArgument
end sub
not sure if all that vb.net is right...should give you some ideas...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message news:eb**************@TK2MSFTNGP12.phx.gbl...
not sure how to get an event raised for my situation.

the primary use of the 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.
then my weak attempt to get an interim arraylist back from the custom control

............. 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() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
Raise an event in your user control, have anyone who cares to hook into the event and retrieve the event argument.

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message news:Oc**************@TK2MSFTNGP14.phx.gbl...
I have a custom server control which renders some html.

I want to capture some interim values generated by the control as it processes the data.

is there a way to capture and retrieve the interim values generated by the control, so they can be used elsewhere in the
display page ?




Mar 14 '06 #5

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

Similar topics

0
by: adam | last post by:
i have custom user control and i'm trying to pass values to custom user control......I need help it seems to me i cannot pass the value to user control from dropdownlist. I have property in a...
9
by: james.e.coleman | last post by:
Hello, I have created a custom dropdownlist that is used multiple times within a single page. When trying to set the values of the controls with the page in which they are being used, they all...
2
by: Steve Franks | last post by:
In ASP.NET 2.0 you can now apparently do this: <asp:label runat="server" text="some browser" IE:text="any IE browser" IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" /> Now the...
3
by: Alan | last post by:
Hi, is it possible to create a project that can offer different members of a Public Enum according to a condition ? I mean, Project A has a public enum. Project B & C access A's enum. However B...
2
by: Pipo | last post by:
Nobody knows how to get the values provided in the client can be read in the user-control? If have made a Web Custom Control with 2 textboxes and 1 dropdownlist. The user fills in my control (the...
0
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an...
0
by: Kay | last post by:
Hello, I have developed a web custom control, I want one of the properties of the control to appear as a dropdown list so the user can select from the list. My question is: how do I define an...
4
by: Jon Paal | last post by:
I am using a custom server control in my webpage which renders some html. while it creates the html, it develops an arraylist of values. Is there a way to capture the arraylist from the control...
2
by: Nathan Sokalski | last post by:
I have a custom control with properties named MinValue, MaxValue, and Value (all of which I have assigned a DefaultValue design-time attribute). The Value property must be between (or equal to) the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.