Explain URL Patterns.
URL Patterns
• Each route must contain a URL pattern. This Pattern is compared to an incoming URL. If the pattern matches the URL, then it is used by the routing system to process that URL.
• The URL Pattern {controller=Home}/{action=Index}/{id?} Registers route where the first part of the URL is Controller, the second part is the action method to invoke on the controller. The third parameter is additional data in the name of id.
• Each segment in the incoming URL is matched to the corresponding segment in the URL Pattern.
• {controller=Home}/{action=Index}/{id?} has three segments. The last one is optional.
Comments
Post a Comment