Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

I already create a Web API in vs 2013 (and it working good), my goals is to return also MVC View to the client for example:
call to url: www.xxx.com/api/home/ should return simple mvc view, my model will update from the web api.

Please advice

Thanks!
Yaniv
Posted

1 solution

You don't.

You can return one or the other, not both.


Frankly, a WebAPI controller returns nothing but data, never a view page. A MVC controller returns view pages.

Yes, your MVC code can be a consumer of a WebAPI, but not the other way around.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900