Error en Button HtmlAttributes

Hello ,

I am using Blazor wasm + net core 5.

When updating syncfusion to the latest version I get this error in buttons that are inside an edit form (the buttons have the assignment HtmlAttributes, except for a button that performs the submit):

System.InvalidOperationException: The property 'HtmlAttributes' on component type 'Syncfusion.Blazor.Buttons.SfButton' cannot be set explicitly when also used to capture unmatched values. Unmatched values: ID


The buttons have this variable assigned

public Dictionary <string, object> HtmlAttribute {get; set; } =

         new Dictionary <string, object> () {{"type", "button"}};


Could you tell me how to correct it?


1 Reply

GK Gayathri KarunaiAnandam Syncfusion Team September 16, 2021 01:08 PM UTC

Hi Marcelo, 

We have checked your reported query. We can achieve your requirement using  @attributes property. Please check the below code snippet. 

<SfButton Content="@Content" @attributes="@Attribute"></SfButton> 
 
Or 
 
<SfButton Content="@Content" Type="button"></SfButton> 
 
 
@code { 
    public string Content = "Button"; 
    private Dictionary<string, object> Attribute = new Dictionary<string, object>() 
     { 
        { "type", "button"} 
    }; 
} 


Please check the sample and if you are still facing issue, kindly share the below details. 

  • If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample.
  • Please share the Syncfusion version you are using.
  • Please share the Code snippet/ Video demonstration to replicate the reported issue.

Please provide the above requested information, based on that we will check and provide you a better solution quickly. 

Regards, 
Gayathri K 


Loader.
Up arrow icon