2011-04-12 36 views
2

我一直在試圖弄清楚這一點,但找不到我的問題的任何答案。我遇到的問題是與此網址:'/'應用程序中的服務器錯誤。具有相同的路線

localhost:343434/Lev/Details/1/4/CON/2 

此網址將返回一個「服務器錯誤/'應用程序中」。我知道我的Action會用這些參數返回一個值。

但是,如果我用同樣的路線,但與其他參數:

localhost:343434/Lev/Details/3/4/FHS/5 

它將調用操作並返回結果。將 「在 '/' 應用程序的服務器錯誤」 只能用 「CON」

的outpus是這樣的,當出現:

The resource cannot be found. 
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /Lev/Details/1/4/CON/2 

這是我的路線:

 routes.MapRoute(
       "LevRoute", 
       "{controller}/{action}/{id}/{source}/{levtyp}/{Levid2}/{page}/{order}", 
       new { controller = "Lev", action = "Details", page =  UrlParameter.Optional, order = UrlParameter.Optional } 

      ); 

感謝幫助提前!

+1

兩件事情:你需要得到實際的異常輸出,我們需要看你的路線。 (雖然我懷疑你的路線存在問題) – 2011-04-12 08:19:52

回答

2

我加入這個對我的Web.config發現我的問題的解決方案:

<configuration> 
    <system.web> 
    <httpRuntime relaxedUrlToFileSystemMapping="true"/> 
    </system.web> 
</configuration> 
相關問題