all control properties in webform

Discussion in 'ASP .Net' started by Rahim, Dec 18, 2003.

  1. Rahim

    Rahim Guest

    i want to change all the label control style Properties,
    server control properties at runtime
    how should i call all the label at runtime, which is
    present at webform,

    any collections????

    i can't remember each control name on the form.

    thanks help me
     
    Rahim, Dec 18, 2003
    #1
    1. Advertising

  2. Every ASP.Net Control has a collection of Controls called "Controls." You
    can loop through that collection of a Control to find all the Controls
    contained in it. To identify Labels in that Collection you would use
    Reflection. The tricky part is that I don't know whether all of your labels
    are contained within the same Controls Collection. For example, you would
    typically start at the WebForm level (the WebForm is the <form> element in
    the Page). Most ASP.Net Controls must reside within an HtmlForm Control in
    order to work. However, looping thtough tyhe Controls Collection of the Form
    may not reveal all of your labels. For example, if a label is inside another
    Control in the Form, it is a member of the Controls Collection of the nested
    Control, not the Form. You could write a recursive function to loop through
    all of the Controls in a Control, and then call itself to loop through all
    the Controls of each Child (etc) to find all of them.

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

    "Rahim" <> wrote in message
    news:034301c3c51b$fa602660$...
    > i want to change all the label control style Properties,
    > server control properties at runtime
    > how should i call all the label at runtime, which is
    > present at webform,
    >
    > any collections????
    >
    > i can't remember each control name on the form.
    >
    > thanks help me
     
    Kevin Spencer, Dec 18, 2003
    #2
    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. adiel
    Replies:
    2
    Views:
    1,036
    adiel
    Jul 2, 2003
  2. titof
    Replies:
    0
    Views:
    512
    titof
    Jul 24, 2003
  3. timmso
    Replies:
    1
    Views:
    492
    Alex Papadimoulis
    Dec 12, 2003
  4. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  5. Sonal
    Replies:
    3
    Views:
    671
Loading...

Share This Page