Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET - how to get the properties of a component?

Reply
Thread Tools

ASP.NET - how to get the properties of a component?

 
 
=?ISO-8859-1?Q?Mika=EBl_PLOUHINEC?=
Guest
Posts: n/a
 
      10-25-2006
Hello,

I work in a ASP.NET (C#) project. I would like to create an user control
with a label and a textBox.

My component myTextBox.ascx is present in my page (aspx) with
<toto:TextBoxPerso ID="TextBoxPerso1" runat="server" /><br />

So I would like to manage the component of my component for example in
the code of my aspx page.

I find I can do that with
((Label)(this.TextBoxPerso1.FindControl("label"))) .Text = "Label 2";

But is there a way to "publish" several properties of my component in
order to access to this like
this.TextBoxPerso1.getLabel().Text = "label 2";

Thanks a lot.

Mike.
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      10-26-2006
You can set your own properties using the technique shown here:

http://samples.gotdotnet.com/quickst...erty.cs&font=3


"MikaŽl PLOUHINEC" <(E-Mail Removed)> wrote in message
news:uclIEIE%(E-Mail Removed)...
> Hello,
>
> I work in a ASP.NET (C#) project. I would like to create an user control
> with a label and a textBox.
>
> My component myTextBox.ascx is present in my page (aspx) with
> <toto:TextBoxPerso ID="TextBoxPerso1" runat="server" /><br />
>
> So I would like to manage the component of my component for example in the
> code of my aspx page.
>
> I find I can do that with
> ((Label)(this.TextBoxPerso1.FindControl("label"))) .Text = "Label 2";
>
> But is there a way to "publish" several properties of my component in
> order to access to this like
> this.TextBoxPerso1.getLabel().Text = "label 2";
>
> Thanks a lot.
>
> Mike.



 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
CompositeControls: ViewState properties w/ Mapped properties probl =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?= ASP .Net 1 01-19-2006 09:19 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
Re: C++ properties Library Created (was Binding together Properties of Objects) Victor Porton C++ 1 08-29-2004 08:02 PM
Problems parsing when Properties.dtd.properties Kent Lichty Java 0 04-16-2004 03:08 PM



Advertisments