Key Value Pair

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

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
 
Usually builder.Attributes.Add("Name", "Value");

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


Pete
 
Usually builder.Attributes.Add("Name", "Value");

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

Pete

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top