This is a migrated thread and some comments may be shown as answers.

[Solved] ASP.NET MVC 2.0 Beta

28 Answers 542 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Scott
Top achievements
Rank 1
Scott asked on 25 Nov 2009, 01:59 AM
After upgrading an ASP.NET MVC 2.0 Preview 2 application that uses the Grid from the MVC Extensions (build 2009_3_1110) to ASP.NET MVC 2.0 Beta... I am now getting the following MissingMethodException that was not occuring previously (I have even tried this with a fresh ASP.NET MVC 2.0 Beta project):

Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ControllerBase.get_ValueProvider()'.

My view(s) include the grid without changes -- and no other portions of the projects have been modified either -- from the project using MVC Preview 2, and the project(s) using MVC 2.0 Beta.  I may simply be missing something, but after much investigation, I'm wondering if this is being caused by the MVC framework changes from preview to beta, or with the MVC extensions, or by some oversight on my part elsewhere in my project.  I'm using the grid in my view(s) with the following configuration:

<% Html.Telerik().Grid(Model)
.Name("Customers")
.PrefixUrlParameters(false)
.Columns(columns => {
columns.Add(c => c.Id);
columns.Add(c => c.CompanyName);
columns.Add(c => c.FirstName);
columns.Add(c => c.LastName);
columns.Add(c => c.Email);
columns.Add(c => c.Phone);
columns.Add(c => c.CreatedOn);
})
.Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
.Pageable(paging => paging.PageSize(10)
.Style(GridPagerStyles.NextPreviousAndNumeric)
.Position(GridPagerPosition.Bottom))
.Scrollable(scrolling => scrolling.Height(250))
.Render(); %>

 

Anyone else run into this exception, or can point me in the direction of some error I'm overlooking elsewhere?

Thanks,
Scott Wade 

 

28 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 26 Nov 2009, 03:05 AM
After further investigation I'm beginning to belive that this problem using the MVC Extensions Grid with MVC 2.0 Beta (which wasn't occuring with MVC 2.0 preview 2) and the MissingMethodException thrown now when rendering the Grid in a View, is caused by a breaking change in MVC 2.0 Beta from MVC 2.0 preview 2 (whereby the IValueProvider interface replaces all usages of IDictionary<string, ValueProviderResult>  which seems to be occuring at the following method call:

    Telerik.Web.Mvc.UI.IGridBindingContext.get_ValueProvider()

GridBindingContextExtensions still contains the following method signature with the IDictionary<string, ValueProviderResult> valueProvider, parameter:
 
public static T ValueOf<T>(this IDictionary<string, ValueProviderResult> valueProvider, string key);

If I'm correct, I suspect waiting for the next build of the Extensions (Telerik.Web.Mvc) will address the problem?

Here's the breaking change (from the release notes for MVC 2.0 Beta) and the Grid usage and full stack trace from a stripped-down and simplified test project below it:

Changes in ASP.NET MVC 2 Beta

Introduced the IValueProvider interface, which replaces all usages of IDictionary<string, ValueProviderResult>.

Every property or method argument that accepted IDictionary<string, ValueProviderResult> now accepts IValueProvider. This change affects only applications that include custom value providers or custom model binders.

Examples of properties and methods that are affected by this change include the following:

·         The ValueProvider property of the ControllerBase and ModelBindingContext classes.



 

 

 

<% Html.Telerik().Grid<InMemoryCustomer>()
                   .Name("MyGrid")
                   .Columns(
                                columns =>
                                {
                                    columns.Add(c => c.Id);
                                    columns.Add(c => c.Name);
                                    columns.Add(c => c.Address);
                                    columns.Add(c => c.RegisterAt).Format("{0:MM/dd/yyyy}");
                                    columns.Add(c => c.IsActive);
                                }
                           )
                   .BindTo(Model)
                   .Render(); %>


StackTrace:   
 at Telerik.Web.Mvc.UI.Grid`1.Telerik.Web.Mvc.UI.IGridBindingContext.get_ValueProvider()
 at Telerik.Web.Mvc.UI.GridBindingContextExtensions.ValueOf[T](IGridBindingContext context, String key)
 at Telerik.Web.Mvc.UI.GridDataProcessor.get_CurrentPage()
 at Telerik.Web.Mvc.UI.GridDataProcessor.EnsureDataSourceIsProcessed()
 at Telerik.Web.Mvc.UI.GridDataProcessor.get_ProcessedDataSource()
 at Telerik.Web.Mvc.UI.Grid`1.WriteRows(IGridRenderer`1 renderer)
 at Telerik.Web.Mvc.UI.Grid`1.WriteTable(IGridRenderer`1 renderer)
 at Telerik.Web.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer)
 at Telerik.Web.Mvc.UI.ViewComponentBase.Render()
 at Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render()
 at ASP.[MY VIEW FILE NAME]_aspx.__Render[MY VIEW]Content(HtmlTextWriter __w, Control parameterContainer) in [MY VIEW FILE LOCATION\MY VIEW FILE NAME]:line 20
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
 at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
 at System.Web.UI.Control.Render(HtmlTextWriter writer)
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
 at ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in [MY PROJECT LOCATION]\\Web\\Views\\Shared\\Site.Master:line 36
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
 at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
 at System.Web.UI.Control.Render(HtmlTextWriter writer)
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
 at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
 at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
 at System.Web.UI.Control.Render(HtmlTextWriter writer)
 at System.Web.UI.Page.Render(HtmlTextWriter writer)
 at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
 at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
 at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
 at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

 

0
Missing User
answered on 26 Nov 2009, 12:07 PM
I'm having the exact same issue. I guess we do need to wait for a new release of Extensions...
0
Kazi Manzur Rashid
Telerik team
answered on 27 Nov 2009, 12:47 AM
Hi Gabriel and Scott,

The ASP.NET MVC2 has breakaing changes with ASP.NET MVC1 which means our extensions are not compatiable with the MVC2. We hope that once the MVC2 hits the RC, we will provide an MVC2 specific version with the existing features.

Regards,
Kazi Manzur Rashid
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Scott
Top achievements
Rank 1
answered on 27 Nov 2009, 02:20 AM
Thanks for the update/confirmation.  Maybe an updated internal build of the extensions prior to MVC 2.0 RC?  It's rock-and-a-hard place situation because the extensions were working well in a lot of areas and functionality with MVC 2.0 preview 2.  Since MVC 2.0 Beta is a VS 2008 only (which is disappointing as well because it pretty much removes the ability to work with MVC 2.0 in VS 2010 once installed... see release notes excerpt below, confirmed by Phil Haack)...it becomes a real chore to "downgrade" the MVC  framework in order to "upgrade" back to VS 2010 and still have some MVC 2.0 framework functionality...but that's the path I'm going to go...  

The MVC Extensions are really great work from you guys...and I look forward to working with it further as it evolves!  Some really helpful blog posts have been coming out as well...keep 'em coming, and thank again.  Here's the bummer among all the great news and bits that came out of PDC last week, IMHO:

"Note:   Because Visual Studio 2008 and Visual Studio 2010 Beta 2 share a component of ASP.NET MVC, installing ASP.NET MVC 2 Beta on a computer where Visual Studio 2010 Beta 2 is also installed is not supported."

   
0
brandon
Top achievements
Rank 1
answered on 01 Dec 2009, 12:04 AM
I am having the exact same problem.  Was banging my head because I tried to load my exisiting .net mvc 2 preview project on a new pc and didn't realize I loaded MVC Beta 2 (not preview) and was getting the same error.
0
Scott
Top achievements
Rank 1
answered on 01 Dec 2009, 02:05 PM
Sounds like the next released build of the extensions will contain 2 versions targeting both... from Kazi Manzur Rashid's blog:  "

From our next release we are planning to include two separate binaries for each version."   Looking forward to it!

0
Will Yeung
Top achievements
Rank 1
answered on 14 Dec 2009, 05:55 PM
grid in telerik is the best tools I can find on the internet.
too bad that we cannot use it now.

when will it be fixed?


Thanks~
0
Atanas Korchev
Telerik team
answered on 15 Dec 2009, 03:32 PM
Hello Will Yeung,

 We are currently working on MVC2 support. Once we are ready with the build I will update this forum thread.


Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
M D
Top achievements
Rank 1
answered on 16 Dec 2009, 11:00 AM
I'm not connected to Telerik, but find the phrase: "when will it be fixed?" by Will Yeung to be misguided.  Telerik MVC Extensions aren't broken, they seem to work happily up to MVC 2 Preview 2.  What you meant, Will, is "When will the Telerik extensions be adapted to work with MVC Beta 2?".

On the other hand, Telerik team, the labling of the project is not clear.  The versions of MVC that the release has been tested and found compatible with should be at least be specified on the download page.

Cheers
Matt
0
Will Yeung
Top achievements
Rank 1
answered on 17 Dec 2009, 02:23 AM
Matt,

Absolutely, sorry for my mis-guided.
Telerik extension is so excellent that I can't find the same thing in other place!

it's just M$ changed 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ControllerBase.get_ValueProvider()'.

It's great if there is a quick tuning. :)

Thanks~

Will
0
Scott
Top achievements
Rank 1
answered on 18 Dec 2009, 04:06 AM
Just wondering if the ASP.NET MVC 2.0 Release Candidate, made available today, will present any additional difficulties or delays in updating the Telerik Extensions for ASP.NET MVC to work with this latest release?  It doesn't appear to have many breaking changes at all from the MVC 2 Beta, provides some needed optimizations and some more bug fixes along with improved validation.  

Also, what is the difference between the Extensions for ASP.NET MVC - Open Source, and the Extensions for ASP.NET MVC, such that they are listed as two different products and downloads?  If the same, would contributions from the community to the source for the Extensions be helpful or accepted?  I'd be willing to volunteer some of my time to the project and help get the product closer to MVC 2 support, and know other developers that would be interested as well, if that is appropriate?

Anyway, love the work you guys are doing, and am anxiously awaiting any announcements from Atanas Korchev or others on the team regarding a new build!  Thank you for your hard work!
0
Atanas Korchev
Telerik team
answered on 18 Dec 2009, 11:15 AM
Hello,

I am glad to announce that we just released our MVC2 compatible bits. Please check my blog post for additional info.

@Scott
You can check the following pages for the differences between the commercial and the open source version.
http://www.telerik.com/purchase/faqs/aspnet-mvc.aspx
http://telerikwatch.com/2009/11/telerik-extensions-for-mvc-unofficial.html

We are currently not accepting patches from the community because we still don't have the required license agreement (so we can use your code in our commercial distribution). We will post an update once we do.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Will Yeung
Top achievements
Rank 1
answered on 18 Dec 2009, 12:14 PM
Very QUICK!!!!
You are super!!!!
I can't wait to download and try~
0
Will Yeung
Top achievements
Rank 1
answered on 21 Dec 2009, 04:25 AM
There is a layout bug.
0
Alex Gyoshev
Telerik team
answered on 21 Dec 2009, 09:54 AM
Hello Will Yeung,

The layout bug will be resolved if you set the Width of each column and enable .Scrolling(). There simply isn't enough space for the data.

I also happened to notice that the filtering icons aren't high enough to cover the whole row - you can adjust that by adding vertical padding to them, using the following style:

.t-grid .t-grid-filter
{
    padding-top: 0.6em;
    padding-bottom: 0.6em;
}


Also, you can set the Filterable() and Sortable() properties on the select and details columns to false, since they do not convey any meaningful data that can be filtered or sorted.

All the best,
Alex
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Scott
Top achievements
Rank 1
answered on 21 Dec 2009, 11:34 PM
Thanks Atanas and Alex...I wasn't expecting the updated build and MVC 2.0 support so quickly!   Your blog posts indicated that the documentation and examples hadn't been updated with the new build to reflect the changes.  Any ETA on when the documentation might be updated...or is that effort going to coincide with the RTM?

Phil's recent post [ http://haacked.com/archive/2009/12/19/aspnetmvc-2-and-vs2010.aspx ] clarified the roadmap for releases of the MVC 2 bits as well as the tooling for VS 2010 and VS 2008... and I'm wondering if documentation and examples for the extensions will simply be updated closer that time, or if any of the Extension builds between this latest and those forthcoming will include updated documentation?  For now, diving into source code can be done to illuminate changes in the API...

Thanks again for all you efforts, and BTW, thanks for supporting DotNetRocks and other podcasts as a company.  Any plans for a Telerik Podcast?  I think it would be great and an invaluable service to go along with the other material available on the telerik website, like Telerik TV!
0
Atanas Korchev
Telerik team
answered on 22 Dec 2009, 07:35 AM
Hello Scott,

The documentation has already been updated but still not uploaded online. However there are no changes in the API of the Telerik MVC Extensions - this means you can use them in the same way as with ASP.NET MVC 1. The sole change which was made is in the implementation of the grid. Namely the type of the ValueProvider property was updated in MVC2 which made the MVC1 buld incompatible. Examples will be updated when we implement MVC 2 specific features - grid editing and client-side validation which is most likely to happen when we release officially our next version - Q1 2010 expected in the beginning of March. Once ASP.NET MVC 2 goes official we will release another update as well.

As for a Telerik podcast - stay tuned. There might be some development in that direction.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David
Top achievements
Rank 1
answered on 04 Jan 2010, 08:51 AM
Thanks for the update - fixed me up in a jiffy!

dave
0
Rinat Al
Top achievements
Rank 1
answered on 17 Jan 2010, 12:37 AM
Error: Method not found: 'System.Collections.Generic.IDictionary`2<System.String,System.Web.Mvc.ValueProviderResult> System.Web.Mvc.ControllerBase.get_ValueProvider()'.

Telerik: Telerik_Extensions_for_ASPNET_MVC_2009_3_1223_OpenSource

ASP.NET MVC 2 RC

    <%= Html.Telerik().Grid<SmsMessageOutboundModel>(Model) 
        .Name("Grid") 
        .Columns(columns => 
        { 
            columns.Add(o => o.SendDate).Width(100); 
            columns.Add(o => o.Body).Width(200); 
            columns.Add(o => o.SentDate).Format("{0:MM/dd/yyyy}").Width(120); 
        }) 
0
Atanas Korchev
Telerik team
answered on 18 Jan 2010, 08:26 AM
Hello Rinat Al,

You are not using the MVC2 dll. Please check my blog post for additional details.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jesse Sanders
Top achievements
Rank 1
answered on 21 Jan 2010, 06:27 PM
I have read your blog, verified that I have the MVC2 dll referenced and I am still getting the error in my proof of concept project.  Any thoughts on why?  Here is my code:

View:

    <%= Html.Telerik().StyleSheetRegistrar()
        .DefaultGroup(group => group.Add("telerik.common.css")
                                    .Add("telerik.windows7.css"))
    %>
    <%= Html.Telerik().Grid<TimeSlot>()
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Add(o => o.Id).Width(100);
            columns.Add(o => o.Time).Format("{0:hh:mm}").Width(120); ;
            columns.Add(o => o.Day);
        })
        .Ajax(ajax => ajax.Action("_ClientSideEvents_Ajax", "Home"))
    %>
    <%Html.Telerik().ScriptRegistrar().jQuery(false).Render(); %>

Controller:

        [GridAction]
        public ActionResult _ClientSideEvents_Ajax()
        {
            return View(new GridModel<TimeSlot>
            {
                Data = GetTimeSlots()
            });
        }

        private IEnumerable<TimeSlot> GetTimeSlots()
        {
            List<TimeSlot> data = new List<TimeSlot>();

            data.Add(new TimeSlot() { Id = 1, Day = DayOfWeek.Sunday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 2, Day = DayOfWeek.Monday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 3, Day = DayOfWeek.Tuesday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 4, Day = DayOfWeek.Wednesday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 5, Day = DayOfWeek.Thursday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 6, Day = DayOfWeek.Friday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });
            data.Add(new TimeSlot() { Id = 7, Day = DayOfWeek.Saturday, Time = new DateTime(1900, 1, 1, 8, 0, 0) });

            return data;
        }
0
Scott
Top achievements
Rank 1
answered on 22 Jan 2010, 02:17 AM
Jesse,

The version of ASP.NET MVC 2.0 you are using looks to be the issue.  Even though you mention that you have verified you are using ASP.NET MVC 2.0 files, it looks like you are using something prior to ASP.NET MVC 2.0 Beta.  Any MVC 2.0 prior to that will cause the error you have presented, as the method causing you the error, no longer exists with that signature.  Only MVC 2.0 prior to the Beta or newer still uses the IDictionary<string, ValueProviderResult> interface...

I would suggest downloading the latest MVC 2.0 Release Candidate, here:  http://www.microsoft.com/downloads/details.aspx?FamilyID=3b537c55-0948-4e6a-bf8c-aa1a78878da0&displaylang=en , and trying your proof-of-concept again. 

From the release notes:

Changes in ASP.NET MVC 2 Beta

Introduced the IValueProvider interface, which replaces all usages of IDictionary<string, ValueProviderResult>.

0
Jesse Sanders
Top achievements
Rank 1
answered on 22 Jan 2010, 02:48 AM
That was the problem... appears that I had a beta preview that wasn't compatible.  Thanks for the response and solution.

Jesse
0
Scott
Top achievements
Rank 1
answered on 22 Jan 2010, 05:17 PM
Glad it worked...and that I could help!

--Scott Wade--
0
Kenny
Top achievements
Rank 1
answered on 10 Feb 2010, 10:23 PM
I also have this problem today :( I've uninstalled all MVC version on the server, then re-install MVC 2 RC 2, Telerik.Web.Mvc displays version 2009.3.1320.235

Any idea why?

Thanks.

Server Error in '/' Application.

Method not found: 'System.Web.Mvc.IValueProvider System.Web.Mvc.ControllerBase.get_ValueProvider()'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.MissingMethodException: Method not found: 'System.Web.Mvc.IValueProvider System.Web.Mvc.ControllerBase.get_ValueProvider()'.

Source Error: 

Line 3:  <h2>Line 4:      NEWEST SONGS</h2>Line 5:  <% Html.Telerik().Grid<NotesnhacLib.Song>(Model.NewestSongsModel.NewestSongs)Line 6:         .Name("NewestGrid")
Line 7:         .Columns(columns =>
0
Kenny
Top achievements
Rank 1
answered on 10 Feb 2010, 11:28 PM
Seems like the DLL has been cached by my server... It work now :)
0
Rodolfo Gonzalez
Top achievements
Rank 1
answered on 07 Apr 2010, 11:44 PM
I am getting this same error (Method not found: 'System.Web.Mvc.IValueProvider System.Web.Mvc.ControllerBase.get_ValueProvider()'.) ... I'm using the latest release up until now.

My project is still MVC 1.0, and I was able to overcome this error by eliminating the project reference to Telerik.Web.Mvc.dll for MVC1 (version 2010.1.309.135), and then adding the reference corresponding to MVC2 (Telerik.Web.Mvc.dll version 2010.1.309.235)...

Am I missing something or from the begining I should have reference the MVC2 dll even when my project is still MVC1? Or is this a bug?

I am using VS 2008 SP1 with MVC1 and MVC2 both installed (I have some projects in MVC1 and others in MVC2 final).

Final question, will I have any problems if I leave my project as MVC1 and use the MVC2 Telerik dll?
0
Atanas Korchev
Telerik team
answered on 08 Apr 2010, 07:21 AM
Hi Rodolfo Gonzalez,

You should use the MVC1 version if your project is MVC1. This exception will be thrown if you are using a different version. Check the last number of the assembly version of Telerik.Web.Mvc.dll. If it is 135 then you are using the MVC1 build. If it is 235 then you are using the MVC2 build.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Missing User
Kazi Manzur Rashid
Telerik team
brandon
Top achievements
Rank 1
Will Yeung
Top achievements
Rank 1
Atanas Korchev
Telerik team
M D
Top achievements
Rank 1
Alex Gyoshev
Telerik team
David
Top achievements
Rank 1
Rinat Al
Top achievements
Rank 1
Jesse Sanders
Top achievements
Rank 1
Kenny
Top achievements
Rank 1
Rodolfo Gonzalez
Top achievements
Rank 1
Share this question
or