Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > bind values of dynamically loaded webcontrols to custom object

Reply
Thread Tools

bind values of dynamically loaded webcontrols to custom object

 
 
ronnel.santiago
Guest
Posts: n/a
 
      10-04-2004
hi guys!

i came across an article of scott mitchell of 4guys entitled "Working with
Dynamically Created Controls, Part 2" and it was really a good read for me
as im doing a web project and doing it as much as possible ALL dynamic.
after reading the article i have some things that are not clear to me. from
his code snippet :

int count = 1;

void IterateThroughChildren(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c.GetType().ToString().Equals("System.Web.UI.WebC ontrols.TextBox")
&& c.ID. == null)
{
((TextBox) c).Text = "TextBox " + count.ToString();
((TextBox) c).Columns = 10;
count++;
}

if (c.Controls.Count > 0)
{
IterateThroughChildren(c);
}
}
}because im following his pattern, my question now is how can i "bind values
of dynamically loaded webcontrols to custom object". to further explain
things, this what i have, i have an Employee Class from which im doing this:

dim objEmployee as Employee
objEmployee.Firstname = ' the value of my dynamically created control
objEmployee.Lastname = ' the value of my dynamically created control
'
so in this approached how can i "BIND VALUES OF DYNAMICALLY LOADED
WEBCONTROLS TO CUSTOM OBJECT"?


TIA,

ronnel.santiago


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically bind data and values to checkboxlist from sql server mtelinc@gmail.com ASP .Net Web Controls 0 08-09-2006 07:06 PM
How do I restore state in a dynamically loaded custom control? Alan Silver ASP .Net 5 02-28-2006 07:03 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
java -verbose doesn't show "loaded from" for classes loaded from custom jars in the classpath Udo Corban Java 0 01-23-2004 09:32 AM
Refer to a custom property of a dynamically loaded user control Bryan Holland ASP .Net Building Controls 1 11-17-2003 11:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57