Hi All,
I am new to angular 8 and asp.net core. I have a situation where I want to create a api url to generate PDF file from ASP.Net Core 3 web api and open in separate window and also to open as a preview mode, for which I use iframe.
My problem is,
I am able to achieve both scenario in localhost with below mentioned code. But when I deploy my application in server machine using iis, separate window opens, but getting this exception
Quote:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'customer/details/standard/FileName'
quick sample of my code
frameUrl(){
var urlString="app_host_path/customer/details/${some_usertype}/${some_filename}?token=token_already_generated";
return this.domSanitizer.sanitize(SecurityContext.RESOURCE_URL,
this.domSanitizer.bypassSecurityTrustResourceUrl(urlString))
}
openPdf(){
window.open(this.frameURL(),"_blank")
}
for preview mode,in html I use this code,
<iframe id="dfrPreviewFrame" [src]="frameUrl"></iframe>
What I have tried:
Generally we use Window.open(url,'_blank') which works fine in localhost, but not in deployed server.
Also I came to know window.open(url) itself will open in separate window,here also works in local but not in server.
Any help, would be appreciated!
Thanks in Advance!!