Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8033685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:46:30+00:00 2026-06-05T01:46:30+00:00

if i have multiple values for same key then how to add it in

  • 0

if i have multiple values for same key then how to add it in hash table
for example:

                   Hashtable hs = new Hashtable();
                      hs["id"]= "x001.xhtml";
                      hs["media-type"]= "application/xhtm+xml"; 
                      hs["href"]= "text/001.xhtml";

                      hs["id"]= "x002.xhtml";
                      hs["media-type"]= "application/xhtm+xml";
                      hs["href"]= "text/002.xhtml";

                     hs["id"]= "x003.xhtml";
                     hs["media-type"]= "application/xhtm+xml";
                     hs["href"]= "text/003.xhtml";

this is taking only last group in hashtable i.e

                     hs["id"]= "x003.xhtml";
                     hs["media-type"]= "application/xhtm+xml";
                     hs["href"]= "text/003.xhtml";

how to solve this….thanks in advance!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:46:32+00:00Added an answer on June 5, 2026 at 1:46 am

    A hashtable is defined as having unique keys, and the indexer replaces existing values. It sounds like you actually want a list of objects, i.e.

    var list = new List<YourType> {
        new YourType { Id = "x001.xhtml", MediaType = "...", Href = "..." },
        new YourType { Id = "x002.xhtml", MediaType = "...", Href = "..." },
        new YourType { Id = "x003.xhtml", MediaType = "...", Href = "..." }
    };
    

    with

    public class YourType {
        public string Id {get;set;}
        public string MediaType {get;set;}
        public string Href {get;set;}
    }
    

    (or similar)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please tell me how can we have multiple values for the same key in
Using Hashtable I want to have multiple objects mapped to the same key. E.g.
I have the object var dataformdata={key1:value1,key2:value2}; then I add some more values with the
Here is an example: Is it possible to have same mapper run against multiple
I have a dictionary structure, with multiple key value pairs inside. myDict.Add(key1, value1); myDict.Add(key2,
I have a form with multiple dropdowns consisting of multiple values. I'm trying to
I have added a parameter to my report with the option Allow Multiple Values
I have a function that uses out parameters to return multiple values to the
I have the following select list from which the user can select multiple values.
Basically: Can my model classes contain @NoBinding annotations with multiple values? If I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.