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

Key Value Pair

Hello,

I am adding an Attribute to a TagBuilder and it accepts a
KeyValuePair:

builder.Attributes.Add( ...

How do I add the KeyValuePair?

I am still used to VB.NET and I am always getting errors in my sintax.

Thanks,
Miguel
Sep 8 '08 #1
2 1799
Usually builder.Attributes.Add("Name", "Value");

If not then try
KeyValuePair<string, stringkvp = new KeyValuePair<string, string>("Key",
"Value");
builder.Attributes.Add(kvp);
Pete

Sep 8 '08 #2
On Sep 8, 10:32*pm, "Peter Morris" <mrpmorri...@SPAMgmail.comwrote:
Usually builder.Attributes.Add("Name", "Value");

If not then try
KeyValuePair<string, stringkvp = new KeyValuePair<string, string>("Key",
"Value");
builder.Attributes.Add(kvp);

Pete
Thanks
Sep 8 '08 #3

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

Similar topics

4
by: Glutinous | last post by:
I've been studying this for hours, searching the www & usenet, and still can't figure out why 'each' returns an array of four key/value pairs, when it looks like just two pairs would suffice... ...
1
by: ritelman | last post by:
Hi I have one text field and one submit button. If I hit the submit button with a mouse the key/value pair key are properly submitted. However, if I just hit the enter key the page does get...
3
by: suresh | last post by:
Hi all, I have a hash table and I want to modify the value of a key. Please let me know how can that be acheived. Thanks Suresh
2
by: orekinbck | last post by:
Hi There I am probably missing something fundamental here, but I cannot see a method to search the values of a generic dictionary so that I can find the key ? Of course I could enumerate...
5
by: homsan toft | last post by:
Hi, I'm (still) trying to return a pair<const Key, T> from iterator dereference. So I defined a proxy class in the obvious way: template<class KeyT, class DataT> struct ref_proxy { typedef...
4
by: Christian Christmann | last post by:
Hi, here is my small program: Header file: Class myClass { public: void function();
2
by: Peter Liu | last post by:
I have many structs, each of which has only one member, for example, hehehh I wrote a template for all of them, but I still want my function foo --standalone-- to output the member of the struct...
6
by: Evyn | last post by:
Hi, How do I compare 2 maps for identical keys, and if they have identical keys, check if they have identical values? In either case I want to copy ONLY that key value pair to one of two...
2
by: james | last post by:
(Sorry if this is a double post) Hi Guys, I am creating a delegate a couple times and passing in a local variable. However, when the delegate is invoked it uses the variable passed into the...
9
by: Mohitz | last post by:
is pair<fine for returning two values? What about more than two values? PS: Values may be of different types. Opinions? Thank you Mohit
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: 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
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,...
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...
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...

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.