我有最新版本的VS 2010,.NET 4.0和MVC 3,使用vb.net时我在使用asp.net mvc 3中的区域时遇到问题.
我做以下事情:
在步骤7,我收到消息"无法找到资源".
如果我使用c#执行完全相同的操作,那么我将进入正确的页面,它将按预期显示"Index"一词.
这是一个错误,还是我错过了什么?我一直在扫描网络几个小时试图解决这个问题,但我现在正在接受.
这是自动创建的TestAreaRegistration.vb文件命名空间TestApp.Areas.Test公共类TestAreaRegistration继承AreaRegistration
Public Overrides ReadOnly Property AreaName() As String
Get
Return "Test"
End Get
End Property
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
context.MapRoute( _
"Test_default", _
"Test/{controller}/{action}/{id}", _
New With {.action = "Index", .id = UrlParameter.Optional} _
)
End Sub
End Class
Run Code Online (Sandbox Code Playgroud)
结束命名空间
这是自动创建的Global.ascx文件:'注意:有关启用IIS6或IIS7经典模式的说明,请访问http://go.microsoft.com/?LinkId=9394802
公共类MvcApplication继承System.Web.HttpApplication
Shared Sub RegisterGlobalFilters(ByVal filters As …Run Code Online (Sandbox Code Playgroud)