Total Page Preview:   000000000421

What is Routing in Asp.Net Core MVC in English and Hindi

Routing in English

Routing in ASP.NET Core MVC refers to the process of determining how incoming HTTP requests should be mapped to controller actions and methods in an MVC application. It involves matching the URL of an incoming request to a specific controller and action that will handle and process the request.

In simpler terms, routing is the mechanism that helps the application understand which code should be executed based on the URL that a user accesses. It plays a crucial role in directing incoming requests to the appropriate controllers and actions, enabling the application to generate dynamic responses and display the correct content to users.
Let's consider a basic example of routing in ASP.NET Core MVC:
 
Suppose you have a simple MVC application for managing products, and you want to handle requests related to different actions, such as displaying a list of products and showing details of a specific product.
Define a Controller:
Configure Routing:
In the Startup.cs file, you'll configure routing in the Configure method using the UseEndpoints method:
 
 
Accessing URLs:
With the configured routing, the application will handle URLs like:
/Product maps to the Index action in the ProductController.
/Product/Details/1 maps to the Details action in the ProductController with the parameter id equal to 1.
So, if a user accesses these URLs, the routing mechanism will direct the request to the appropriate controller actions, and the corresponding logic will be executed to generate and display the appropriate views.
 
Routing in Hindi
ASP.NET Core MVC mein routing ka matlab hota hai ki kaise aane wale HTTP requests ko controller actions aur methods se map kiya jaye jo MVC application mein hote hain. Ismein incoming request ke URL ko specific controller aur action ke saath match kiya jata hai, jo request ko handle aur process karenge.
Simpler shabdon mein, routing woh mechanism hai jo application ko samajhne mein madad karta hai ki URL ke aadhar par kaunsa code execute hona chahiye, jise user access karta hai. Yeh incoming requests ko sahi controllers aur actions mein redirect karne ka mahatvapurna tarika hai, jo application ko dynamic responses generate karne aur users ko sahi content display karne mein madad karta hai.

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments


                           
                           

                           

                           

Facebook User: