473,788 Members | 2,707 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 1653
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
2867
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
2699
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
3363
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
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10370
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...
1
10113
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
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
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
7519
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
5402
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.