[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Rich

3/11/2002 6:23:00 PM

Hi all,

I tried to use Panel server control in my mobile application. The control
contains another three child controls - 2 text boxes and one button. The
question is how can I access properties of these child controls (like Text
property for Text Box control). I'm able to access only Panel properties,
methods and events.

Thanks!

Rich


4 Answers

Frank DeFalco

3/11/2002 10:08:00 PM

0

Rich,

You'll probably want to use the Controls collection on the panel class. You
can access the controls in the container like this:

Label2.Text = Panel1.Controls[0].ID;

hope this helps.

Frank

"Rich" <rich@tely.com> wrote in message news:uH$6mFSyBHA.604@tkmsftngp04...
> Hi all,
>
> I tried to use Panel server control in my mobile application. The control
> contains another three child controls - 2 text boxes and one button. The
> question is how can I access properties of these child controls (like Text
> property for Text Box control). I'm able to access only Panel properties,
> methods and events.
>
> Thanks!
>
> Rich
>
>


Rich

3/12/2002 1:12:00 AM

0

Thanks but it doesn't work. Panel1.Controls[0].ID returns empty string. What
I need is accessing Text property of Label control which is inside Panel
control.

Rich


> You'll probably want to use the Controls collection on the panel class.
You
> can access the controls in the container like this:
>
> Label2.Text = Panel1.Controls[0].ID;
>
> hope this helps.
>
> Frank




Infinit Loop

3/12/2002 4:17:00 AM

0


Example from different post.

myLabel =
CType(Panel1.Controls(0).FindControl("expirationDate"),System.Web.UI.MobileC
ontrols.Label)
myLabel.text blah blah blah.

james

"Rich" <rich@tely.com> wrote in message news:uH$6mFSyBHA.604@tkmsftngp04...
> Hi all,
>
> I tried to use Panel server control in my mobile application. The control
> contains another three child controls - 2 text boxes and one button. The
> question is how can I access properties of these child controls (like Text
> property for Text Box control). I'm able to access only Panel properties,
> methods and events.
>
> Thanks!
>
> Rich
>
>


Shanku Niyogi

3/13/2002 9:13:00 PM

0

Rich,

It really depends on WHEN you do this. Once the panel receives the Init
event, the control tree under it should be ready, and initialized.

Also, are you looking at a control directly inside the panel, or in a child
or a content template?

Thanks,
Shanku


"Rich" <rich@tely.com> wrote in message news:uJuzOqVyBHA.1372@tkmsftngp02...
> Thanks but it doesn't work. Panel1.Controls[0].ID returns empty string.
What
> I need is accessing Text property of Label control which is inside Panel
> control.
>
> Rich
>
>
> > You'll probably want to use the Controls collection on the panel class.
> You
> > can access the controls in the container like this:
> >
> > Label2.Text = Panel1.Controls[0].ID;
> >
> > hope this helps.
> >
> > Frank
>
>
>
>