<SfTextBox > .net 6 syfusion controle blazor version 19.3.0.59

Password  set not working kindly check bellow code .

model

[Required(ErrorMessage = "Password is required")]

        [StringLength(10, ErrorMessage = "Must be between 5 and 255 characters", MinimumLength = 5)]

        [DataType(DataType.Password)]

        public string? PASSWORD { get; set; } = "";

        [Required(ErrorMessage = "Confirm Password is required")]

        [StringLength(10, ErrorMessage = "Must be between 5 and 255 characters", MinimumLength = 5)]

        [DataType(DataType.Password)]

        [Compare("Password")]


  <SfTextBox Enabled="true" Placeholder="Password *" Type="InputType.Password" Autocomplete="AutoComplete.Off"

                                   FloatLabelType="@FloatLabelType.Auto"

                                   @bind-Value="addeditAppUser.PASSWORD"></SfTextBox>

                        <ValidationMessage For="@(() => addeditAppUser.PASSWORD)"></ValidationMessage>

                        <SfTextBox Enabled="true" Placeholder="Confirm Password*" type="InputType.Password" Autocomplete="AutoComplete.Off"

                                   FloatLabelType="@FloatLabelType.Auto"

                                   @bind-Value="addeditAppUser.confirmPASSWORD"></SfTextBox>


Error: An unhandled exception occurred while processing the request.

InvalidCastException: Unable to cast object of type 'System.String' to type 'Syncfusion.Blazor.Inputs.InputType'.

Microsoft.AspNetCore.Components.Reflection.PropertySetter.CallPropertySetter<TTarget, TValue>(Action<TTarget, TValue> setter, object target, object value)

InvalidOperationException: Unable to set property 'type' on object of type 'Syncfusion.Blazor.Inputs.SfTextBox'. The error was: Unable to cast object of type 'System.String' to type 'Syncfusion.Blazor.Inputs.InputType'.

1 Reply

BC Berly Christopher Syncfusion Team December 15, 2021 06:05 PM UTC

Hi Pradeep, 
  
Greetings from Syncfusion support. 
  
We have checked the shared code and suggest you to define the type property with correct casing to resolve the reported issue.  
  
 <SfTextBox Enabled="true" Placeholder="Confirm Password*" Type="InputType.Password" Autocomplete="AutoComplete.Off" 
                                   FloatLabelType="@FloatLabelType.Auto" 
                                   @bind-Value="addeditAppUser.confirmPASSWORD"></SfTextBo 
 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon