How do I use the web api for controllers and MVC for view(Front-end)?

Asked

Viewed 169 times

0

hello, my problem is this, I’m doing an internship test and the guy asked to do an Asp.net project with mvc only for views, and web api only for controllers and another layer for the bank only that I could not make mvc recognize the controllers in the web api, are separate projects, are 3 projects in the same Solution, could someone help me? thank you

  • 1

    Post project code/images so someone can help you more easily.

  • Controller is in another Solution? just register in the global.asax by passing the name of . dll

  • Dude, I don’t know much Asp, I know refenciar os projeto, but how would I know the name of this dll?

1 answer

0

Do the following Checklist:

  • If you are testing in the browser, check that the [Httpget] is in the controller method you are trying to call.
  • Check if the Webapiconfig class is registered at least the Default route
  • Check that the project references are correct.
  • In this case as you are testing the web.api you have to define it as Startup Project to run the project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.