Error 8 Delegate 'System.Func<object,object>' does not take 0 arguments c:\Program Files\Telerik\Extensions for ASP.NET MVC Q2 2010\Examples\Telerik.Web.Mvc.Examples\Views\Grid\DetailsServerSide.aspx 41 77 Telerik.Web.Mvc.Examples
It's on this line of code & is referring to the Content method:
items.Add().Text(
"Orders").Content(() =>
{
I see it in the Telerik examples (above) but on the example it does not stop processing. In my project the error prevents the view from displaying.
I notice that I see this when there is more than one tab in a tab strip, you get this & the following errors on all but the first tab - and you don't get the error on the first tab.
Error 9 Not all code paths return a value in lambda expression of type 'System.Func<object,object>' c:\Program Files\Telerik\Extensions for ASP.NET MVC Q2 2010\Examples\Telerik.Web.Mvc.Examples\Views\Grid\DetailsServerSide.aspx 41 77 Telerik.Web.Mvc.Examples
Error 10 Cannot convert lambda expression to type 'string' because it is not a delegate type c:\Program Files\Telerik\Extensions for ASP.NET MVC Q2 2010\Examples\Telerik.Web.Mvc.Examples\Views\Grid\DetailsServerSide.aspx 41 77 Telerik.Web.Mvc.Examples
Any suggestions?
14 Answers, 1 is accepted
Could you please send me a sample project reproducing your issue, so I will be able to better assist you?
All the best,Hristo Germanov
the Telerik team
Could you look at that (see above) and let me know if you get the same compile errors?
I cannot reproduce those problems in our example. Also it seems to work ok online. What do we need to do in order to see those errors?
Regards,Atanas Korchev
the Telerik team
When you build the example, do you see those errors?
I am able to run the example with the errors.
In my own project the errors prevent the view from displaying & I don't know why that is either.
No, I don't see any errors during compilation. I guess I need more info about your environment. Please specify the following:
- Which version of ASP.NET MVC are you using?
- Which version of Visual Studio?
Atanas Korchev
the Telerik team
Do you suppose it's some sort of build option or something we're missing?
Thanks!
I am sending a working sample which compiles and runs without a problem. Does it work for you? If not - please send us some screenshot showing the error output.
Regards,Atanas Korchev
the Telerik team
I still see the same 3 errors but the app does run & the view works fine.
Error 1 Delegate 'System.Func<object,object>' does not take 0 arguments c:\Downloads\Nov15230731_telerik-web-mvc-examples\Telerik.Web.Mvc.Examples\Views\Home\Index.aspx 41 77 Telerik.Web.Mvc.Examples
Error 2 Not all code paths return a value in lambda expression of type 'System.Func<object,object>' c:\Downloads\Nov15230731_telerik-web-mvc-examples\Telerik.Web.Mvc.Examples\Views\Home\Index.aspx 41 77 Telerik.Web.Mvc.Examples
Error 3 Cannot convert lambda expression to type 'string' because it is not a delegate type c:\Downloads\Nov15230731_telerik-web-mvc-examples\Telerik.Web.Mvc.Examples\Views\Home\Index.aspx 41 77 Telerik.Web.Mvc.Examples
They are for the 2nd "Items.Add" statement:
items.Add().Text("Contact Information").Content(() =>
{
%>
<div class="employee-details">
Maybe I'll try the Ajax version & see if that works.
I am not sure what is wrong but I don't see any build errors. I even enabled Build Mvc Views as part of the process and still I don't see any errors. Here is a video showing how things look at my side. Let me know if I am doing anything wrong.
Regards,Atanas Korchev
the Telerik team
Thank you again for looking at this!
The debugger from visual studio 2010, shows the red underline on the second "(" from the line with ".Content(() =>"
tabstrip.Add()
.Text("Prueba")
.Content(() => {%>
but, when I delete or cut the line with the ActionLink, the error disappears...
I'm also facing the same issue. I'm attatching project along with the error screen shot. Please provide some information for this issue.
Note: i'm getting the same error in the attatched project in the reply by Atanas Korchev below.
Thanks,
Shreejit
The attached project suffers from different problems.
First it is using <%= and Render() at the same (for the inner grid declaration).
The proper way to output a Telerik Extension is either to use <%= Html.Telerik().Grid() %> (as all other ASP.NET MVC html helper extensions) or <% Html.Telerik().Grid().Render(); %> if the component is using templates. The latter is needed because the <%= %> syntax does not support nesting and is specific to Telerik extensions. If you are using .NET 4.0 you can also use <%: Html.Telerik().Grid() %>. The <%: %> syntax will do the same as <%= %> thus has the same limitation - does not support nesting.
The second problem is that you are using a Entity Framework collection inside the ASPX page. The ASP.NET compiler does not import that namespace by default. You need to add the following line in your web.config to make the ASP.NET compiler recognize EF types:
<assemblies>
<!-- other assemblies omitted for brevity -->
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
I am sending the updated project.
Atanas Korchev
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>