mccalltd/AttributeRouting — Issue #44: Route works only on top of controller. Why?
Author: shapper
Created: 2012-02-10 17:01:11+00:00
State: open

Hello,

I have the following routes on a controller:

[GET("Users")]
public virtual ActionResult Index(Int32 p = 1)

[GET("Users/New")]
public virtual ActionResult New()

[POST("Users"), ValidateAntiForgeryToken]
public virtual ActionResult Create(UserNewModel model)

[GET("Users/{id}")]
public virtual ActionResult Show(Int32 id)

[GET("Users/{id}/Edit")]
public virtual ActionResult Edit(Int32 id)

[PUT("Users/{id}"), ValidateAntiForgeryToken]
public virtual ActionResult Update(Int32 id, UserEditModel model)

[GET("Users/{id}/Delete")]
public virtual ActionResult Delete(Int32 id)

[DELETE("Users/{id}"), ValidateAntiForgeryToken]
public virtual ActionResult Destroy(Int32 id)

[GET("Users/SignIn")]
public virtual ActionResult SignIn()

[POST("Users/SignIn"), ValidateAntiForgeryToken]
public virtual ActionResult SignIn(UserSignInModel model)

When I try to access Users/SignIn I get a 404 error.

If I move this action to the top in the controller then it works fine.

But I don't see why.

Any idea?

Thank You,
Miguel