在Win25008 R2的服务器上面。程序池是单独的且是集成模式。
处理程序映射添加的是托管处理程序,添加脚本映射不管用。在Web.config里面生成
<add name="ALL" path="*" verb="*" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" preCondition="integratedMode" />
路由设置是:
 routes.MapPageRoute("Class",
    "{Aclass}/",
    "~/C.aspx");
http://www.abc.com/123/这样的网址我是可以访问了,路由生效了。但我直接访问http://www.abc.com/网站域名就会出现错误。
Server Error in '/' Application.
The resource cannot be found.
我在线等,知道的大神们说下,谢谢。

解决方案 »

  1.   

    给一个默认值,即没有{Aclass}时路由到哪个页面。
      

  2.   

    会不会是要加个routes.Ignore。但我不会写。
      

  3.   

                routes.MapRoute(
                    "Default", // 路由名称
                    "{controller}.aspx/{action}/{id}", // 带有参数的 URL
                    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // 参数默认值
                );
      

  4.   

    我是说routes.Ignore我不会写。
    问题还没有解决。就是网站域名www.abc.com访问不了。www.abc.com/index.aspx都是可以访问的。
      

  5.   

    增加一个默认default.aspx<script runat="server">    protected override void OnLoad(EventArgs e)
        {
            string originalPath = Request.Path;
            HttpContext.Current.RewritePath(Request.ApplicationPath, false);        IHttpHandler httpHandler = new MvcHttpHandler();
            httpHandler.ProcessRequest(HttpContext.Current);
            HttpContext.Current.RewritePath(originalPath, false);
        }</script>看看灵不灵