开发者

MVC routing problem ... need to type /home

My MVC3 website on my pro开发者_Python百科duction Windows Server 2008 R2 (SP1) is bugging me and I need your help.

If I type ... http://www.mywebsite.com ... it shows me the IIS7.5 Welcome Screen. But if I type http://www.mywebsite.com/home ... then everything works fine.

Here's my global.asax:

Public Class MvcApplication
    Inherits System.Web.HttpApplication

    Shared Sub RegisterGlobalFilters(ByVal filters As GlobalFilterCollection)
        filters.Add(New HandleErrorAttribute())
    End Sub

    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( _
            "Default", _
            "{controller}/{action}/{id}", _
            New With {.controller = "Home", .action = "Index", .id = UrlParameter.Optional} _
        )
    End Sub

    Sub Application_Start()
        AreaRegistration.RegisterAllAreas()
        RegisterGlobalFilters(GlobalFilters.Filters)
        RegisterRoutes(RouteTable.Routes)
    End Sub

End Class

I tried aspnet_regiis -ir, but that didn't help.

Any idea why it doesn't work without the /home ???

Thanks a million!!

Mojo


Did you check the default Website configuration of IIS. Is it maybe pointing to some static ressource?


Don't know what solved it, but it's gone now.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜