Hello
I have a Blazor Server Web App (.Net 6) and just started using Syncfusion (19.40.0.53) this week. I have followed the instructions to set up Blazor components in Program.cs and installed my community license keys. I have been successful in reproducing your Cascading Dropdown example.
However, when I try the FileUpload component, the component renders correctly but nothing happens when I click on the Browse button. The button highlights but there is no prompt to select a file. When I drag a file onto the drop box, the file is immediately downloaded. The FileSelectedHandler is not fired. My code is below:
@page "/userfilesmanager"
@using Syncfusion.Blazor.Inputs
<h3>Component</h3>
<SfUploader MaxFileSize=104857600 AutoUpload=false>
<UploaderEvents FileSelected="@FileSelectedHandler"></UploaderEvents>
</SfUploader>
<style>
.control-wrapper {
width: 350px;
margin: 0 auto;
}
</style>
@code {
private void FileSelectedHandler(SelectedEventArgs args)
{
// Here, you can customize your code.
}
}
I think I have solved this issue. The problem was the line of code in my program.cs file, which I found in one of the SyncFusion tutorials:
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
The input component worked when I modified it to this:
builder.Services.AddSyncfusionBlazor();
I hope this helps someone. Or if someone can explain when/why the option => options.IgnoreScriptIsolation = true; is needed that would be helpful.
thanks!
Thanks for your reply Prince.
However, as I indicated above - if I include this line:
builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; });
..then my SyncFusion components do not seem to work correctly:
a) Menu layout is wrong (location of items on window is out of whack)
b) Dropdowns do not work at all.
If I replace that line with: builder.Services.AddSyncfusionBlazor(); then all works well.
W
Many thanks Prince. That seemed to have worked after I put the above into my _Layout.cshtml file.
Now the dropdowns work if I include builder.Services.AddSyncfusionBlazor(options => { options.IgnoreScriptIsolation = true; }); in my Program.cs file.
I have one question though: how doe the rel='nofollow' href to "
_content/Syncfusion.Blazor.Themes/bootstrap5.css" work?
If I look in my wwwroot folder, there is no _content subfolder? Can you maybe just confirm this is correct?
Thanks again for your help!
|
|
Thank you very much for this clarification Sureshkumar.
Kind Regards
Fritz