I was looking for a way to load different data from the database based on an ID or name in the URL.
For example:
This is the link to the view:
http://localhost:50830/CreateSale/Order
Now I want something like this:
http://localhost:50830/CreateSale/Order/5
OR
http://localhost:50830/CreateSale/Order/Cookies
And then based on the ID (5) or the name (Cookies), the controller CreateSale will load the data that is linked to the ID/name in the Order view. This data will be different for every ID/name.
EDIT
So basically what I want is a way to create a URL like the one I showed. So when I type the link into the browser, depending on the the last part (5 or Cookie), it should show the desired data on the page.
For example:
If the link is:
http://localhost:50830/CreateSale/Order/Cookies
Then I want to see data about ordering cookies on the page.
When the link is:
http://localhost:50830/CreateSale/Order/Toys
Then I want to see data about ordering toys on the page.
Is there any way to do this in asp.net mvc4?
Thanks!