473,399 Members | 2,159 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,399 software developers and data experts.

Get Server Property Names Programatically?

Somebody help me learn which class and methods may be used to get the names
of all properties for a given server control? Thank you...

--
<%= Clinton Gallagher, "Twice the Results -- Half the Cost"
Architectural & e-Business Consulting -- Software Development
NET cs*********@REMOVETHISTEXTmetromilwaukee.com
URL http://www.metromilwaukee.com/clintongallagher/
Nov 16 '05 #1
2 1687
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Somebody help me learn which class and methods may be used to get the names
of all properties for a given server control? Thank you...


Clinton,

The classes you should look at are in the System.Reflection namespace. Usually,
you'll start out by calling GetType( ) on an object (it can be any object, it doesn't
need to be a server Control) and from a Type object you can query all sorts of
CLR metadata on that type such as it's properties.

using System.Reflection;
// . . .
PropertyInfo[ ] props = serverControl1.GetType( ).GetProperties( );

Gets you all of the public instance properties on the serverControl1's Type as
an array of PropertyInfo objects (which have properties like Name and
PropertyType that describe the nature of the property).
Derek Harmon
Nov 16 '05 #2
Thanks Derek. I was using the Object browser and wondering how to read
properties in code as I think that's going to be the most expedient
methodology for those interested in generating ASP.NET 2.0 .skin files for
any given theme.

<%= Clinton Gallagher

"Derek Harmon" <lo*******@msn.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Somebody help me learn which class and methods may be used to get the names of all properties for a given server control? Thank you...


Clinton,

The classes you should look at are in the System.Reflection namespace.

Usually, you'll start out by calling GetType( ) on an object (it can be any object, it doesn't need to be a server Control) and from a Type object you can query all sorts of CLR metadata on that type such as it's properties.

using System.Reflection;
// . . .
PropertyInfo[ ] props = serverControl1.GetType( ).GetProperties( );

Gets you all of the public instance properties on the serverControl1's Type as an array of PropertyInfo objects (which have properties like Name and
PropertyType that describe the nature of the property).
Derek Harmon

Nov 16 '05 #3

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

Similar topics

11
by: Laszlo Zsolt Nagy | last post by:
My problem is about properties and the virtuality of the methods. I would like to create a property whose get and set methods are virtual. I had the same problems in Delphi before and the solution...
0
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
0
by: Joe | last post by:
I wrote a simple server control that inherits from the DropDownList control. I will be using the control in an aspx page and want to access it in a repeater. I have created a public property...
0
by: Joe | last post by:
I am having a hard time with setting a property on a custom server control that i am placing in a repeater. The control inherits from DropDownList. The property is being set in the repeater using...
2
by: Kevin R | last post by:
I'm trying to get asp.net 1.1 running on my home PC. When I try creating a new ASP.NET Web Application in 'Visual Studio .NET 2003' I get the following error: "Visual Studio .NET has detected...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
20
by: piggy | last post by:
I have developed an application using C# under .NET 2.0 framework. It is almost done and it is time for me to think about deploymnet to all users. I don't have any background about this and would...
0
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I'm trying to programatically set a StyleSheetTheme for a web user control. I understand that in order to use the Page.StyleSheetTheme property I must override the base class property. But...
7
by: sachinkale123 | last post by:
Hi, I am developing one web application where I am adding a job to sql server 2005 scheduler programatically. When I run code i m able to add job to schedular but it does not execute on time. If I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.