bind values of dynamically loaded webcontrols to custom object

Discussion in 'ASP .Net Web Controls' started by ronnel.santiago, Oct 4, 2004.

  1. 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.WebControls.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
     
    ronnel.santiago, Oct 4, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo Birnbach [MS]
    Replies:
    0
    Views:
    3,338
    Marcelo Birnbach [MS]
    Jun 28, 2003
  2. Alan Silver
    Replies:
    5
    Views:
    2,590
    Alan Silver
    Feb 28, 2006
  3. Udo Corban
    Replies:
    0
    Views:
    3,882
    Udo Corban
    Jan 23, 2004
  4. Bryan Holland

    Refer to a custom property of a dynamically loaded user control

    Bryan Holland, Nov 17, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    183
    Dave Rothgery
    Nov 17, 2003
  5. Replies:
    0
    Views:
    289
Loading...

Share This Page