Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Oct 22, 2019 @ 15:09
    Ismail Mayat
    0

    custom routing for surface controller in v8

    I have a surface controller and need todo some custom routing so i have:

        [RoutePrefix("api/people")]
    public class ProfileImageController : SurfaceController
    {
    
        [Route("GetImage/{hrID}")]
        public FileResult Get(int hrID)
    

    i would expect the following to work /api/people/GetImage/12334

    However i get 404.

    I have component where i have

                GlobalConfiguration.Configuration.MapHttpAttributeRoutes();
    

    So it should work? Unless my url is incorrect?

    Anyone any ideas?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Oct 22, 2019 @ 15:24
    Ismail Mayat
    1

    Ok i was missing:

                RouteTable.Routes.MapMvcAttributeRoutes();
    

    that fixed it

Please Sign in or register to post replies

Write your reply to:

Draft