Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Can Blazor programatically trigger a click on a hidden InputFile without JavaScript?

$
0
0

Can I trigger a click on a hidden input type file element?

<InputFile OnChange="@LoadFiles" multiple hidden /><button class="btn btn-secondary" @onclick="SelectFile" type="button"><i class="icons8-upload"></i> Upload file(s)</button>@code {    private void SelectFile() {        //click the InputFile without JS    }    protected async Task LoadFiles(InputFileChangeEventArgs e) {       // do something    }}

Is there a way in Blazor to do that without JavaScript?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>