Mandar Shinde

Mandar Shinde

  • NA
  • 423
  • 115.6k

Unable to point to API Controller in ASP. Net MVC

May 11 2019 4:55 AM
Hello All,
I have developed my  small application using Angular 5 and ASP .Net MVC 5 with Rest Api.
Last time I was facing one problem related to refreshing web page on IIS uploaded.
To overcome on above problem I have created one web.config file for Angular 5 purpose which is as follows :-
 
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <configuration>  
  3. <system.webServer>  
  4.   <rewrite>  
  5.     <rules>  
  6.       <rule name="Angular Routes" stopProcessing="true">  
  7.         <match url=".*" />  
  8.         <conditions logicalGrouping="MatchAll">  
  9.           <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />  
  10.           <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />  
  11.         </conditions>  
  12.         <action type="Rewrite" url="./index.html" />  
  13.       </rule>  
  14.     </rules>  
  15.   </rewrite>  
  16. </system.webServer>  
  17. </configuration>  
 But now I am facing new problem is that because of use URL Rewrite I am not able to communicate with my ASP .Net MVC code.
 
Please suggest me some easy  solution to overcome on above solution.
Any suggestion will be acceptable.
Thanking You in advance.
Regards 

Answers (1)