Razor partial view – Html.RenderPartial – Cannot implicitly convert type ‘void’ to ‘object‘

Razor Html.RenderPartial “Cannot implicitly convert type ‘void’ to ‘object’.”
When I tried to render my partial view with a standard call I got a compile time error saying “Cannot implicitly convert type ‘void’ to ‘object’.”

The reason behind this compile time error was the RenderPartial() call renders its result directly to the response object and cannot be used like a simple string result.

To resolve the issue, all you have to do is enclose the call in a code block.

{Html.RenderPartial

Advertisements

ASP.NET vNext – Quick Introduction

A few weeks ago, microsoft announced ASP.NET vNext and plans for the future of .NET on the serverASP.NET vNext is designed for both cloud and server, offering SxS installation options and significantly enhanced developer productivity, through a modular and highly configurable framework and web stack.

ASP.NET vNext is a lean and composable framework for building web and cloud applications. ASP.NET vNext is fully open source and available on GitHub. ASP.NET vNext is currently in preview. Using ASP.NET vNext you will be able to compile C# 6 and VB with the Roslyn compilers, host ASP.NET vNext apps on the server or cloud, compile your Windows Store apps with the .NET Native ahead of time compiler, and enjoy faster desktop and server apps with the Next Generation JIT.

ASP.NET vNext includes updated versions of MVC, Web API, Web Pages, SignalR and EF. The key improvement with these frameworks is that MVC, Web API and Web Pages have been merged into a single programming model. ASP.NET vNext is an open source project released under Apache License Version 2.0 by Microsoft Open Technologies, Inc. You can follow its progress and find instructions on how to contribute on https://github.com/aspnet .

ASP.NET vNext

To learn more about the ASP.NET vNext announcements, check below links:

 

ASP.NET MVC Release History, Supported Visual Studio versions and .NET Framework

ASP.NET MVC is a web application development framework built on top of Microsoft’s .NET Framework. ASP.NET MVC framework is a lightweight, highly testable presentation framework that is integrated with existing ASP.NET features.

Here I’m listing down the ASP.NET MVC versions and its release dates,

ASP.NET MVC version history , release dates, supported visual studio and .net frameworks

Let us see the stable ASP.NET MVC versions and its supported Visual Studio versions ( and .NET Frameworks ) together,

ASP.NET MVC 1 – Visual Studio 2008 and Visual Studio 2008 Service Pack 1 (.NET Framework 3.5)

ASP.NET MVC 2 – Visual Studio 2008 and 2010 (.NET Framework 3.5, 4.0)

ASP.NET MVC 3 – Visual Studio 2010 (.NET Framework 4.0)

ASP.NET MVC 4 – Visual Studio 2010 Service Pack 1 and Visual Studio 2012 (.NET Framework 4.0, 4.5)

ASP.NETMVC 5 – Visual Studio 2013 (.NET Framework 4.5, 4.5.1)