473,378 Members | 1,607 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.

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 1571
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...
1
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: 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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.