Created
February 18, 2025 04:26
-
-
Save donma/4b1284a8b3092c8bd59d3a3e0ca51d36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //add using | |
| using System.Web.Routing; | |
| public class Global : System.Web.HttpApplication | |
| { | |
| protected void Application_Start(object sender, EventArgs e) | |
| { | |
| RegisterRoutes(RouteTable.Routes); | |
| } | |
| public static void RegisterRoutes(RouteCollection routeCollection) | |
| { | |
| // product/product_id | |
| routeCollection.MapPageRoute("PRODUCT", "product/{id}", "~/product.aspx", false, null, | |
| new RouteValueDictionary { { "id", ".*?" } }); | |
| // product/product_id/product_desc | |
| routeCollection.MapPageRoute("PRODUCT_DESC", "product/{id}/{desc}", "~/product.aspx", false, null, | |
| new RouteValueDictionary { { "id", ".*?" } }); | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment