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

How do I maintain list of controls across posts for a WebControl?

I have created a custom control that derives from WebControl. The custom
control assigns other controls dynamically to the Controls collection. Is
there anyway that I can recall the lost of controls that I assigned to my
custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Nov 18 '05 #1
5 1568
Keep track of what Controls are being added, and persist that data somewhere
(such as ViewState). Then, on PostBack, read from your "list" and re-add the
appropriate Controls.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ken Varn" <nospam> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
I have created a custom control that derives from WebControl. The custom
control assigns other controls dynamically to the Controls collection. Is
there anyway that I can recall the lost of controls that I assigned to my
custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------

Nov 18 '05 #2
Keep track of what Controls are being added, and persist that data somewhere
(such as ViewState). Then, on PostBack, read from your "list" and re-add the
appropriate Controls.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ken Varn" <nospam> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
I have created a custom control that derives from WebControl. The custom
control assigns other controls dynamically to the Controls collection. Is
there anyway that I can recall the lost of controls that I assigned to my
custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------

Nov 18 '05 #3
I thought about doing it that way, but it seemed like a lot of redundant
data. I end up sending the same stuff twice to the client. Maybe it isn't
significant enough to worry about it. I was trying to keep my ViewState
data down to a minimum.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Kevin Spencer" <uc*@ftc.gov> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
Keep track of what Controls are being added, and persist that data somewhere (such as ViewState). Then, on PostBack, read from your "list" and re-add the appropriate Controls.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ken Varn" <nospam> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
I have created a custom control that derives from WebControl. The custom control assigns other controls dynamically to the Controls collection. Is there anyway that I can recall the lost of controls that I assigned to my custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------


Nov 18 '05 #4
I thought about doing it that way, but it seemed like a lot of redundant
data. I end up sending the same stuff twice to the client. Maybe it isn't
significant enough to worry about it. I was trying to keep my ViewState
data down to a minimum.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Kevin Spencer" <uc*@ftc.gov> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
Keep track of what Controls are being added, and persist that data somewhere (such as ViewState). Then, on PostBack, read from your "list" and re-add the appropriate Controls.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ken Varn" <nospam> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
I have created a custom control that derives from WebControl. The custom control assigns other controls dynamically to the Controls collection. Is there anyway that I can recall the lost of controls that I assigned to my custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------


Nov 18 '05 #5
This seems like redundant data. If I put it in ViewState, I am duplicating
the data that is already on the screen. Can I somehow have the controls
post back with the form?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Kevin Spencer" <uc*@ftc.gov> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
Keep track of what Controls are being added, and persist that data somewhere (such as ViewState). Then, on PostBack, read from your "list" and re-add the appropriate Controls.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Ken Varn" <nospam> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
I have created a custom control that derives from WebControl. The custom control assigns other controls dynamically to the Controls collection. Is there anyway that I can recall the lost of controls that I assigned to my custom control when I receive postback?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------


Nov 18 '05 #6

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

Similar topics

5
by: Jonathan Williams | last post by:
Hi, I have an object which inherits from WebControl (CUSTOM : WebControl) In this object I have code in which I add child contols: protected override void CreateChildControls() {...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
3
by: Ken Varn | last post by:
I have created a custom control that derives from WebControl. The custom control assigns other controls dynamically to the Controls collection. Is there anyway that I can recall the lost of...
7
by: Tim | last post by:
I am trying to load both server and user controls into placeholder controls on a aspx template page at runtime. These values would be strings that are returned from a database query. I know I can...
3
by: msnews.microsoft.com | last post by:
Hello All, I am trying to write Web Controls and in most of the samples I came across, I am seeing the following function where a HTML string is written to create HTML Controls. ///...
4
by: antonyliu2002 | last post by:
I am new to the .NET framework. I know this has been discussed many times in this group. I also read extensively here, however, I am in bad luck: none of the sample code provided in this forum...
0
by: dustbort | last post by:
ASP.NET 1.1 I want to enhance the existing web controls to add special data-binding features like provider-consumer relationships and the ability to automatically add validation based on database...
2
by: ThunderMusic | last post by:
Hi, I have a custom WebControl. I fire an event and send, as the EventArg, another WebControl that contains sub controls (ParseChildren(true))... It can contain anything, but I want to find one...
3
by: Jonathan Wood | last post by:
I could really use some help on this. First of all, I want to create a Web control where I render the control completely from scratch based on information from a database. In the book...
2
by: Lloyd Sheen | last post by:
Ok I have created a small testbed site for testing and I am have a problem with the terms Usercontrol, Webcontrol, etc. What I need to do in the long run is have a page using AJAX and having...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.