4

I am trying to use the build-in attribute routing that comes with Mvc 5, previously I was using the AttributeRouting package on Nuget.

But how do i set up routes by specifying whether it is for a Get or Post request?

In AttributeRouting there was GET() and POST() attributes, but in Mvc 5 there is only a Route() Attribute?

1 Answer 1

3

You can still use the PostAttribute in MVC5, it's fully supported.

"The earlier style of routing, called convention-based routing, is still fully supported. In fact, you can combine both techniques in the same project."

source

Sign up to request clarification or add additional context in comments.

2 Comments

Great, so when binding the routes it will look for whether the Get or Post attributes are also applied and use them when registering the Route?
Perfect, I assume you mean the HttpPost and HttpGet Attributes - thanks :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.