User1482956676 posted
Hello
I get an HttpException (details below) after installing Visual Studio 2010 Pro RTM in an application developed using Visual Studio 2010 RC. The platform used was ASP.NET MVC2 RTW (already under VS10 RC).
I first uninstalled all RC software and even ASP.NET MVC 2, and then did a "clean" install of VS10 RTM. The ASP.NET MVC 2 version now installed on my dev machine is 2.0.50217.0.
Exception Message:
Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
InnerException Message:
<FilePath>\Views\Language\RenderLanguageNavigation.ascx(6): error BC30451: 'Model' is not declared. It may be inaccessible due to its protection level.
The error occurs on this "Html.RenderAction":
<div id="langNav">
<% Html.RenderAction("RenderLanguageNavigation", "Language") %>
</div>
The "LanguageController" just calls into another service function as below:
Public Shared Function GetLanguagesReadOnly() As IEnumerable(Of Language)
Dim result As IEnumerable(Of Language)
Using ctx As New MyEntities
result = (From l In ctx.Languages
Order By l.Name Ascending
Select l).ToList
End Using
Return result
End Function
Does anybody have an idea what is causing the problem?
Edit:
By the way, I might also share the actual view (partial view) that would show the languages to select from:
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of IEnumerable(Of Language))" %>
<%= "" %>
<ul class="langNav">
<%
For Each item In Model%>
<li><%= Html.ActionLink(item.Name, "SwitchLanguage", "Language",
New With {.id = item.Code.Trim,
.redirectUrl = Context.Request.RawUrl}, Nothing)%></li>
<% Next %>
</ul>