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 845485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:27:35+00:00 2026-05-15T06:27:35+00:00

I was previously using How can a formcollection be enumerated in ASP.NET MVC? ‘s

  • 0

I was previously using How can a formcollection be enumerated in ASP.NET MVC? ‘s implementation but now I’m on VS2010 and MVC2 its complaining:


Error   1   Cannot implicitly convert type 'System.Web.Mvc.IValueProvider' to 
'System.Collections.Generic.IDictionary'. An 
explicit conversion exists (are you missing a cast?)    C:\~\ProjectMVC\Controllers\TheController.cs    line    ProjectMVC

The code is …

IDictionary<string, ValueProviderResult> tmpCollection = collection.ToValueProvider();

for (int j = 1; j <= noprops; j++)
            {
                string shopNmTmp =
                    (from t in tmpCollection
                     where t.Key.StartsWith(j + ".discount.sname." + j)
                     select t.Value.AttemptedValue).First();
                string shopCdTmp =
                    (from t in tmpCollection
                     where t.Key.StartsWith(j + ".discount.sref." + j)
                     select t.Value.AttemptedValue).First();
...

Did something change when I wasn’t looking; this compiles and works and runs and has no issues in MVC1; but wont compile in 2.

Thanks

Update

I techically just fixed this by using:

Dictionary<string, string> tmpCollection = collection.AllKeys.ToDictionary(k => k, v => collection[v]);

instead.

But I’d still be interested in why it changed between versions.

  • 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-05-15T06:27:35+00:00Added an answer on May 15, 2026 at 6:27 am

    I techically just fixed this by using:

    Dictionary<string, string> tmpCollection = collection.
                                     AllKeys.ToDictionary(k => k, v => collection[v]);
    

    Linebreak added after collection. for formatting

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

Sidebar

Related Questions

Can I access the ASP.NET Cache object from Application_Start? I was previously using it
I previously created a website using ASP.NET that stores contact information and can produce
How can I add a row to array using PDO. Previously i did it
previously i was using picture box and its built in utilities to draw some
I am previously using VSTS 2008 + C# + .Net 3.5 + Silverlight 3.0
I'm new to asp.net mvc. I'm looking to create some control for reusing html.
Previously I was using Rewriter.net to rewrite my urls. I used a format like:
I'm trying to start my previously installed service using net start servicename . I
I was previously using initWithContentsOfURL to download a plist into an NSDictionary, but this
Hello Freinds I am new to this Asp.net MVC Control.. I have a page

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.