1

我为我的网站设置了以下路线图。在本地运行和调试完美。我可以将网站发布到我的服务器(www),但只有根页面有效(http://www.domain.com)。一旦我指定了一个控制器(http://www.domain.com/Project),它就会停止工作......

我究竟做错了什么?

全球.asax.vb

' Note: For instructions on enabling IIS6 or IIS7 classic mode, 
' visit http://go.microsoft.com/?LinkId=9394802

Public Class MvcApplication
Inherits System.Web.HttpApplication

Shared Sub RegisterRoutes(ByVal routes As RouteCollection)
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}")

    ' MapRoute takes the following parameters, in order:
    ' (1) Route name
    ' (2) URL with parameters
    ' (3) Parameter defaults

    routes.MapRoute("ProjectsByCategory", "Project/Category/{id}", _
                    New With {.controller = "Project", .action = "ListByCategory", .id = ""}, _
                    New With {.id = "^[0-9]+"})


    routes.MapRoute( _
        "Default", _
        "{controller}/{action}/{id}", _
        New With {.controller = "Project", .action = "Index", .id = ""} _
    )

End Sub

Sub Application_Start()
    Common.LoadEntitySpacesFactory()
    RegisterRoutes(RouteTable.Routes)
End Sub
End Class
4

2 回答 2

3

您要部署到 IIS6 服务器吗?如果是这样,您需要在此处详细执行一些步骤。如果不是,您能否再解释一下该错误 - “它停止工作......”究竟是什么意思?

于 2009-04-29T18:59:50.217 回答
0

您要部署到 IIS5 吗?如果是这样,请遵循

于 2009-04-29T19:00:33.570 回答