2011-12-01 15 views
2

私はすでに私のCMSで働いている友好的なURLを取得することができました。しかし、私が知りたいことは:asp.net 4.0のルートオプションでは、どのようにルートを残してルートを取得するのですか?弊社についてですwww.mysite.com/page_name、中​​にユーザーの種類は、それがページcms.aspxに行くが、そのまま他のルートを離れたとき:ASP.NETルートとCMS

 routes.Clear(); 
     // Register a route for Products/{ProductName} 
     routes.MapPageRoute(
      "View Product",    // Route name 
      "Products/{ProductName}", // Route URL 
      "~/products.aspx"  // Web page to handle route 
     ); 


     // Register a route for Products/{ProductName} 
     routes.MapPageRoute(
      "ShoppingCart",  // Route name 
      "{ShoppingCart}", // Route URL 
      "~/Basket.aspx"  // Web page to handle route 
     ); 


     // Register a route for Products/{ProductName} 
     routes.MapPageRoute(
      "ShoppingCart",  // Route name 
      "{ShoppingCart}", // Route URL 
      "~/Basket.aspx"  // Web page to handle route 
     ); 

    // --->> How do i do this 

    // Register a route for url/{pagename} 
     routes.MapPageRoute(
      "cms",  // Route name 
      "{}", // Route URL 
      "~/cms.aspx"  // Web page to handle route 
     ); 
+0

MVCいないが、私はasp.netのWebフォームアプリケーションでこれを使用しています – rogue39nin

答えて

1

私はあなたがルートコントローラを探していると思います。これにより、コントローラ名を削除して、次のような情報が表示されます。 {url}/action URLをクリーンアップするのが目的ですか?

参照:Having trouble with a simple MVC route