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

Working with Tags

Can someone please tell me what I'm doing wrong in my code? I'm trying to
change the ENABLED property of a User Control Button using the tag property
when another User Control Button is clicked.

Dim sControls As ControlCollection = Me.Parent.Controls
Dim y As Control

For Each y In sControls
If y.Tag = "select" Then
y.Text = "test"
End If
Next
I can run the same code on other controls in the form and it runs fine; but
when I try to change this User Control Button Property it doesn't do
anything. What am I doing wrong?
--
TC
Nov 22 '05 #1
2 1093
I figured out what I did wrong. For anyone interested; I had to enter the tag
in the User Control Property and then I had to Rebuild the Control.
--
TC
"Terrance" wrote:
Can someone please tell me what I'm doing wrong in my code? I'm trying to
change the ENABLED property of a User Control Button using the tag property
when another User Control Button is clicked.

Dim sControls As ControlCollection = Me.Parent.Controls
Dim y As Control

For Each y In sControls
If y.Tag = "select" Then
y.Text = "test"
End If
Next
I can run the same code on other controls in the form and it runs fine; but
when I try to change this User Control Button Property it doesn't do
anything. What am I doing wrong?
--
TC

Nov 22 '05 #2
Terrance,

It can be a lot and important is what you mean with you mean what is going
wrong.

(Getting an error, it does not change, etc. )
Dim sControls As ControlCollection = Me.Parent.Controls
Dim y As Control


\the above is from version 2003 not needed

Probably can you better give the name of the control instead of Parent it
seems for me a little bit weird now because this can be everything.

\\\\
For Each ctr as Control In xx.Controls
If y.Tag.ToString = "select" Then
'are you sure that the case is right by the wa
y.Text = "test"
End If
Next
///

Maybe this helps,

Cor
Nov 22 '05 #3

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

Similar topics

18
by: Phill Long | last post by:
this is the the code, now here is the final result.... I get one combo box and one tex box come up, but they are empty... DAMN!!! Any ideas on what Im doing wrong please.. Thanks Again <?php...
8
by: Michael Wohlwend | last post by:
Hi, this is my first xpath try and after reading many web-pages that xpath is still not working :-( (btw, it's my own project, not a homework) I have something like that: <root> <one/>
2
by: Frances Del Rio | last post by:
please, can you go to http://www.francesdelrio.com/dhtml/ when you click the name of the character the font color for all the lines of that character should change.. this is a simple DHTML...
5
by: jedbob | last post by:
I used Adobe Imageready to build a simple rollover navigation bar, where the text will change color on a mouse over. The working example can be found at:...
4
by: bissatch | last post by:
I am trying to use DIV tags and a class to hide the DIV and the HTML within. I will use JavScript to change it from hidden to visible but that will come later. Below is the code I am using ...
4
by: Tim Mulholland | last post by:
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file just fine. I have another page where i've done...
3
by: sewerized | last post by:
Hello all, I'm having a problem with a user preferences form I'm creating. I want to use dynamic dropdown SELECT boxes for this so my page doesn't get cluttered with 100000 links. Since I...
1
by: suneel271 | last post by:
code working in internet explorer but not in mozilla and iam getting erroe like window.event has no properties and here is the code <%@ page language="java" contentType="text/html;...
1
by: ajos | last post by:
hi friends, Im developing a web based project in struts framework, i have certain forms in them, which contain date field among others. For this purpose i got a calender pop-up from here tigra ....
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
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.