473,386 Members | 1,841 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,386 software developers and data experts.

Attributes of Controls on a Page

I am still very new to all this, so please bear with me.

I am trying to create a debugButton, which when pressed would give me a
list of all the controls on a page and their attributes, but I just
can't work out the syntax. I have tried lots of combinations of the
code below, but rather than show that I will show it in pseudo code
dim cntrl as control
dim attr as attribute

for each cntrl in page.controls

response.write("Control: " & cntrl.name & "Type: " & control.type &
"<BR>")

for each attr in cntrl.attributes

if not isnothing(cntrl.attibute) then
response.write(attr.name & " = " & attr.value)
next
next
You will see from the above how naive I am in VB OOP syntax

Thanks

Tim

May 23 '06 #1
2 881
There is already built-in support for this. See:

http://msdn2.microsoft.com/en-US/library/hfe9f0s0.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

"mosscliffe" <pa***********@googlemail.com> wrote in message
news:11**********************@38g2000cwa.googlegro ups.com...
I am still very new to all this, so please bear with me.

I am trying to create a debugButton, which when pressed would give me a
list of all the controls on a page and their attributes, but I just
can't work out the syntax. I have tried lots of combinations of the
code below, but rather than show that I will show it in pseudo code
dim cntrl as control
dim attr as attribute

for each cntrl in page.controls

response.write("Control: " & cntrl.name & "Type: " & control.type &
"<BR>")

for each attr in cntrl.attributes

if not isnothing(cntrl.attibute) then
response.write(attr.name & " = " & attr.value)
next
next
You will see from the above how naive I am in VB OOP syntax

Thanks

Tim

May 23 '06 #2
Thanks for that tip, I had not got as far as investigating trace. That
has raised many more questions.

The most obvious one is why my button1 routine is not in the Trace
Information List.

But I would still like to achieve my original request, so that I can
create a page, for documentation purposes, that gives me a list of the
attributes, which have been set for each control.

Thanks

Tim

May 23 '06 #3

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

Similar topics

4
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. ...
8
by: sumit | last post by:
Hi, I want to add one java script function on the click of page button of datagrid. But how to get UI control of page button so that i should be able to add attribute for onClick event. ...
7
by: localhost | last post by:
What is the best and/or fastest way to enumerate attributes of an HTML control? In my page template, I have: <body id="myBody" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"...
0
by: Paul Rees | last post by:
I am wondering if anyone has encountered a similar problem to the one that I am having. I have an ASP.NET page which has a table and a dropdownlist that was added at design time. The majority of...
1
by: Sanjay Pais | last post by:
I built a custom control for all the basic web.ui.controls like textbox, label, checkbox etc etc. I added my custom attribute called ApplySecurity to the html in the page. However, when I cycle...
3
by: | last post by:
For a given web form, I want to know what the +simplest+ way to add an attribute to all of a particular control type on that page. For example, I might want to add an onClick attribute to all...
3
by: J'son | last post by:
Guys, I have created a custom class that derives from DataList so that I can add some custom client side functionality into each new item row (<td>). Heres the class in its simplest form: ...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
1
by: LG | last post by:
I want to add attributes to a custom dropdownlist and I found some code on Internet that doesn't work after post back. First time the control has the attributes, but after postback the attributes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...

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.