1111
October 15, 2024, 4:51pm
1
Is it possible to upload files using a menu item instead of a button?
enchev
October 16, 2024, 5:50am
2
There is public Upload() method that can be executed from anywhere you need:
/// <summary>
/// Gets or sets the child content.
/// </summary>
/// <value>The child content.</value>
[Parameter]
public RenderFragment ChildContent { get; set; }
/// <summary>
/// Uploads this instance selected files.
/// </summary>
public async Task Upload()
{
await JSRuntime.InvokeAsync<string>("Radzen.upload", fileUpload, Url, Multiple, false, ParameterName);
}
readonly IDictionary<string, string> headers = new Dictionary<string, string>();
internal void AddHeader(string name, string value)
{
if (name != null)
{
1111
October 17, 2024, 10:48am
3
I'm confused. need to create an instance of the RadzenUpload class and call its Upload? I'm trying and getting an Error: System.ArgumentNullException: Value cannot be null. (Parameter 'jsRuntime')
enchev
October 17, 2024, 10:53am
4
It will be been if you check our demos. You cannot upload anything without having RadzenUpload to pick your files.