Back to Devexpress

DxUpload.SelectButtonText Property

blazor-devexpress-dot-blazor-dot-dxupload-babbc7be.md

latest2.0 KB
Original Source

DxUpload.SelectButtonText Property

Specifies the select button’s text.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public string SelectButtonText { get; set; }

Property Value

TypeDescription
String

The text displayed in the select button.

|

Remarks

The Upload displays the Select File button that invokes the open file dialog. Use the SelectButtonText property to change this button’s text.

razor
<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/Upload/"
          SelectButtonText="Select My File">
</DxUpload>
csharp
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BlazorDemo.AspNetCoreHost;
[Route("api/[controller]")]
[ApiController]
public class UploadController : ControllerBase {
    [HttpPost("[action]")]
    public ActionResult Upload(IFormFile myFile) {
        try {
            // Write code that saves the 'myFile' file.
            // Don't rely on or trust the FileName property without validation.
        } catch {
            return BadRequest();
        }
        return Ok();
    }
}

To hide this button, set the ShowSelectButton property to false.

You can also use the ExternalSelectButtonCssSelector property to implement an external select button.

See Also

DxUpload Class

DxUpload Members

DevExpress.Blazor Namespace