473,775 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding custom attributes to elements

Hi group

I am trying to add a custom attribute to all .NET elements such as
textboxes, labels, datagrids etc. I want to add an attribute called
'key'. I already have the code working for the key attribute (it is
used to localise text within the element) but .NET reports that the
attribute is not valid.

Although the code works I would prefer not to get the warning each
time myself or one of the other coders use the key attribute. Is
there a way I can add the key attribute to all elements so that a
warning is not given?

Thanks for any help you can offer

Paul
Jul 21 '05 #1
2 1652
Paul,

When you do something, and ask for help, please explain for what.

Datagrids, labels, textboxes have the name Controls, so what are "Elements".

You need something however does not write for what it is only to find text
however where, you keep it again in ridle?

One thing I understand you have named something "key"

And than you ask help, because it gives an error somewhere when the "key" is
used whatever you mean with that.

Cor
Jul 21 '05 #2
Hi group

Apologies, I thought what I wrote would be sufficient.

I am using the Microsoft Localisation Toolkit within my current
project. The key attribute is used for all controls such as textboxes,
drop down lists etc and is used to identify what text to retrieve from
the database.

However, when using the key attributes the following warning (not an
error Cor) is given:
"Could not find any attribute 'key' of element 'Label'"

Therefore, is there a way to stop .NET giving a warning every time I
wish to use the attribute 'key'? Is there a way of adding custom
attributes to controls without warnings?

Thanks for any help
Cor Ligthert wrote:
Paul,

When you do something, and ask for help, please explain for what.

Datagrids, labels, textboxes have the name Controls, so what are "Elements".
You need something however does not write for what it is only to find text however where, you keep it again in ridle?

One thing I understand you have named something "key"

And than you ask help, because it gives an error somewhere when the "key" is used whatever you mean with that.

Cor


Jul 21 '05 #3

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

Similar topics

3
2866
by: __PPS__ | last post by:
Hello, I'm newbe to xml/dtd (and probably I don't use all the termins correctly). I'm writing an application that parses xhtml file with custom elements and splits it into 2 parts - valid xhtml1.0 and a script file. basicly I have this: .... <MYML:form action=""> <MYML:input type="text"> ... ... </MYML:form> ....
8
2188
by: nicolas.sanguinetti | last post by:
Hi, I want to add custom attributes to my xhtml documents to use with my DOM scripts. For example, I want to have some tags -say, the <h1>- have an attribute and a . The thing is that I also want the document to validate against xhtml 1.1 :-) How can I define a Schema (and embed it in my xhtml) to expand XHTML default and add this custom attributes?
2
359
by: Paul Dunstone | last post by:
Hi group I am trying to add a custom attribute to all .NET elements such as textboxes, labels, datagrids etc. I want to add an attribute called 'key'. I already have the code working for the key attribute (it is used to localise text within the element) but .NET reports that the attribute is not valid. Although the code works I would prefer not to get the warning each time myself or one of the other coders use the key attribute. Is
3
3261
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: public class MyDataList : DataList { public string MyValue1 = "alert('Hey there!');"; public string MyValue2 = "alert('Hey there yourself!');";
2
2221
by: Ken Fine | last post by:
In code, I'm adding javascript attributes to form elements on an ASP.NET page: body.Attributes.Add("onClick", "highlight(event);"); body.Attributes.Add("onKeyUp", "highlight(event);"); title.Attributes.Add("onClick", "highlight(event);"); title.Attributes.Add("onKeyUp", "highlight(event);"); description.Attributes.Add("onKeyUp", "highlight(event);"); description.Attributes.Add("onClick", "highlight(event);");
10
1969
by: Andy Fish | last post by:
Hi, I would like to include extra "hidden" information in a generated HTML page that can be used by javascript functions. I realise that most browsers seem to ignore any tags and attributes they don't understand, but from what I can tell the standards do not allow me to make up my own tags or attributes as they will fail validation. is there any standard element name that can be used for such a purpose i.e.
2
13892
by: P4trykx | last post by:
Hello I'm want to add some custom attributes to WebControls using WebControl.Attributes.Add("abc","234"); So the html output will look like this, <input type="hidden" abc="123" /etc. I know that I need to modify .dtd file and tell the browser that abc i legal attribute. But I have another problem, I can't change the abc attribute using
4
2698
balabaster
by: balabaster | last post by:
Okay, I decided that I needed to understand the whole custom configuration file bits and so I've spent some time playing around with it. It seems (in the most) relatively straight forward. However, I've come unstuck with one scenario that I'm trying to figure out the code for: Consider the following configuration: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="DummySection"...
0
3362
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="alarm-manual alarm-manual.xsd" <h:p>Text ... <a:par-value name="myName"/... text </h:p>
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10267
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8939
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.