.netangular.net-8.0angular14

Why pressing link on WhatsApp causes blank page, as if it reloaded an old page?


App uses Angular v14, and C# .Net v8.

Let's clarify the question. One had a page with the routing element like this.

RouterModule.forRoot([
      { path: 'abc', loadChildren: () => import('./components/abc/abc.module').then(m => m.ABCModule)},
      { path: '', redirectTo: 'abc', pathMatch: 'full'},
    ], {onSameUrlNavigation: 'reload'}),

The page itself doesn't have problem. Copy the link myhost.com/abc on browser, it had no problem. The only problem lies when you share it on WhatsApp and click on it, which by default it'll open your default browser. What does it displays? It seems to not load the router! The navbar link looked different, clicking on them does not trigger anything. What happened?


Solution

  • There may be a lot of answers, but for one, it's due to IIS. If you deployed it in Sites, remember to change the "Application Pool" from .Net CLR Version v4.(some numbers) to No Managed Code. That basically solved the problem.