Fred
Fred

Reputation: 1221

Blazor Server side onclick in IE11 not working

I am trying to get Blazor (server-side) to work with IE11 (it works with Chrome). But IE 11 doesn't seem to respond to onclick="@ExportExcel". I have added blazor.polyfill.min.js from https://github.com/Daddoon/Blazor.Polyfill but it's doesn't help. Thanks in advance!

Front end code below.

@inject ExcelExportService EES

<div>
    <button onclick="@GetTransferFile">Transfer Excel file</button>
</div>

@functions {

    protected async Task GetTransferFile()
    {
        await EES.TransferFile();
    }
}

Edit In _Host.cshtlm I have added polyfill.min.js as suggested by Issac

<body>

    <script crossorigin="anonymous" src="https://polyfill.io/v3/polyfill.min.js"></script>
    <script type="text/javascript" src="blazor.polyfill.min.js"></script>
    <app>
        @(await Html.RenderComponentAsync<App>())
    </app>


    <script src="_framework/blazor.server.js"></script>
</body>

I now saw in the console log an error message "CSS3111: @font-face encountered unknown error." I commented out bootstrap just for testing and I still get the error. I am guessing it is the @ before GetTransferFile in onclick that is making a fuzz.

Upvotes: 1

Views: 1906

Answers (1)

enet
enet

Reputation: 45684

Try to add this polyfill: https://polyfill.io/v2/docs/

You should remember that even in server-side execution mode Blazor uses some new JavaScript constructs which are not supported by older browsers, for example promises, Fetch API, etc.

Hope this helps...

Upvotes: 3

Related Questions