[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Creating Mobile Controls at runtime

(Dennis)

8/3/2002 3:31:00 PM

Hi,

Is it possible to create mobile controls dynamically?
My problem is that I don't know how many labels I need on my mobile
form because it depends on the query results of the database.

So I would like to create a new label for every retrieved record from
the database.

Thanks for any help

Dennis
2 Answers

Richard Hatt

8/4/2002 5:46:00 PM

0

Yes, use

Dim cLabel as New System.Web.UI.MobileControls.Label()
Controls.Add(cLabel)
With cLabel
.Text = "My Label"
.BreakAfter = True
....
End With

To position the control, use Controls.AddAt(...)

Adding controls dynamically can mess up the ViewState,
but this should not happen with Label controls.

>-----Original Message-----
>Hi,
>
>Is it possible to create mobile controls dynamically?
>My problem is that I don't know how many labels I need
on my mobile
>form because it depends on the query results of the
database.
>
>So I would like to create a new label for every
retrieved record from
>the database.
>
>Thanks for any help
>
>Dennis
>.
>

Baccarin

8/4/2002 7:55:00 PM

0

Dennis,
I'm not a great MIT programmer, but why don't use you ObjectList instead of
labels? Using it, you can 'simulate' many labels through databinding, and
you can use templates.

Baccarin.

"Dennis" <nitehawk@di-ve.com> escreveu na mensagem
news:dadba183.0208030427.5d4a8d92@posting.google.com...
> Hi,
>
> Is it possible to create mobile controls dynamically?
> My problem is that I don't know how many labels I need on my mobile
> form because it depends on the query results of the database.
>
> So I would like to create a new label for every retrieved record from
> the database.
>
> Thanks for any help
>
> Dennis