473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

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.
Oct 25 '06 #1
1 987
You can set your own properties using the technique shown here:

http://samples.gotdotnet.com/quickst...erty.cs&font=3
"Mikaël PLOUHINEC" <mi**@cerealog.frwrote in message
news:uc****************@TK2MSFTNGP03.phx.gbl...
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.

Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fred Chen | last post by:
Hi, I've created a custom component. I want one of the properties of my custom component to be the output file name which is found in project properties. I know that I can get this by writing...
1
by: Sujith Manuel | last post by:
Hi All, I have one component developed in C#. It has got three properties and only one of them will be having value at design time. This means that values of other two properties will be null. ...
3
by: Martin Montgomery | last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc Thank ...
10
by: Jeff Grills | last post by:
I am an experienced C++ programmer with over 12 years of development, and I think I know C++ quite well. I'm changing jobs at the moment, and I have about a month between leaving my last job and...
0
by: Kat | last post by:
Hi I'm making a component in C# (Visual Studio 2003) that is a 2D game board. The board is supported by a 2D array of objects. At design time, the programmer can place the objects onto the...
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
5
by: ganeshokade | last post by:
Dear Experts, I have to write a C# program with the following requirements. I have to make two components (call C1 and C2) both of which can be included by an end user into his project. I have not...
1
by: miskomisko | last post by:
..net v2.0, VS 2005, VB6 Hi, I try to import my vb6 application to vb .net. The application uses my special activeX component which i want to import. When i import ocx file. Component is...
5
by: Jon Pope | last post by:
I've got a class which contains properties. I can supply this class to the Properties control, and it will properly display the properties and allow the user to edit them, etc. I would like to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.