473,785 Members | 2,829 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1126
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******** ******@TK2MSFTN GP14.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:myCustomC ontrol id="CustomContr ol1" runat="server" />"

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

Sub LoadProperties( oThis)
othis.Chart_ali gn = "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.builda rraylist()

............. 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.NullRefe renceException: Object reference not set to an instance of an object.

Source Error:

Line 1415: writer.AddAttri bute("align", Chart_align.ToS tring() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:ud******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP14.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 CommandEventHan dler

have a function that raises it

private sub RaiseValueChang ed(newValue as string)
dim args as new CommandEventArg s("ValueChanged ", newValue)
RaiseEvent ValueChanged(ar gs)
end sub
you can then hook into the event on the page..

AddHandler othis.ValueChan ged, AddressOf(SomeF unction)
sub SomeFunction(so urce as object, e as CommandEventArg s)
dim newValue as string = e.CommandArgume nt
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******** ******@TK2MSFTN GP12.phx.gbl...
not sure how to get an event raised for my situation.

the primary use of the custom control is achieved with :

"<cc1:myCustomC ontrol id="CustomContr ol1" runat="server" />"

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

Sub LoadProperties( oThis)
othis.Chart_ali gn = "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.builda rraylist()

............ 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.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:

Line 1415: writer.AddAttri bute("align",
Chart_align.ToS tring() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:ud******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP14.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******** *****@TK2MSFTNG P12.phx.gbl...
you need to define an event in your control, ala:

public event ValueChanged() as CommandEventHan dler

have a function that raises it

private sub RaiseValueChang ed(newValue as string)
dim args as new CommandEventArg s("ValueChanged ", newValue)
RaiseEvent ValueChanged(ar gs)
end sub
you can then hook into the event on the page..

AddHandler othis.ValueChan ged, AddressOf(SomeF unction)
sub SomeFunction(so urce as object, e as CommandEventArg s)
dim newValue as string = e.CommandArgume nt
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******** ******@TK2MSFTN GP12.phx.gbl...
not sure how to get an event raised for my situation.

the primary use of the custom control is achieved with :

"<cc1:myCustomC ontrol id="CustomContr ol1" runat="server" />"

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

Sub LoadProperties( oThis)
othis.Chart_ali gn = "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.builda rraylist()

............ 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.NullRefe renceException: Object reference not set to an instance of an object.

Source Error:

Line 1415: writer.AddAttri bute("align", Chart_align.ToS tring() )


"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:ud******** ******@TK2MSFTN GP10.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******** ******@TK2MSFTN GP14.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
1909
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 control. In a default.aspx page <SkinExample:Hello id="HelloControl" SkinName="red" runat="server" /> i can pass the value, it works fine, but from the dropdownlist in a codebehind page i can't pass the value. Could some one help me out with...
9
2346
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 are set to the value of the last control. I found this link: http://www.codecomments.com/archive315-2005-1-366113.html which I think explains the situation but I'm not sure how to implement the solution in my case since I am not using a .ascx...
2
2099
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 tokens "IE5" and "PIE" are coming from the updated browser capabilities component. I'd like to do the same thing, but create my own tokens that have nothing to do with the browser capabilities component because I love the convenience this offers.
3
1488
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 should see some elements of the enum while C should see others... Is this achievable ??
2
1699
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 textboxes and the dropdownlist) and lots more stuff on the page. When the user wants to save the page he'll click the save button. The server gets the postback but I can read out the filled in controls (in my control). The textboxes text = ""...
0
1268
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 editor to fill up the dropdown list, so far I have the following code which displays the property as a dropdown but I do not know how to get values it to it, I have only 3 values. Public Class EntryModeEditor Inherits...
0
1241
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 editor to fill up the dropdown list, so far I have the following code which displays the property as a dropdown but I do not know how to get values it to it, I have only 3 values. Public Class EntryModeEditor Inherits...
4
1159
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 so it can also be used on the same web page ? this needs to happen in the post back.
2
1220
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 MinValue and MaxValue properties in order to avoid a runtime error. I want to give an error during the usage of the control stating this, as well as prevent it from compiling under these conditions. Because this is something I have never done...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10151
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8973
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.