Blazor RZ10001 The type of component 'InputDate' cannot be inferred based on the values provided.

Michael Luna 16 Reputation points
2020-12-17T05:38:41.207+00:00

This code

<InputDate id="Date" class="form-control"
    placeholder="Date"
   @bind-value="objWeatherForecast.Date" />

produces the following:
Error RZ10001 The type of component 'InputDate' cannot be inferred based on the values provided. Consider specifying the type arguments directly using the following attributes: 'TValue'.

The Same Issue is occurs for InputNumber and InputSelect

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,477 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Washington_Michael 11 Reputation points
    2020-12-17T14:09:12.877+00:00

    @Michael Luna - This code should work:

    <EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">  
      
        <InputDate @bind-Value="exampleModel.Date" />  
      
        <button type="submit">Submit</button>  
    </EditForm>  
      
    @code {  
        public class WeatherForecastClass  
        {  
            public DateTime Date { get; set; }  
      
            public int TemperatureC { get; set; }  
      
            public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);  
      
            public string Summary { get; set; }  
        }  
      
        private WeatherForecastClass exampleModel = new WeatherForecastClass();  
      
        private void HandleValidSubmit()  
        {  
        }  
    }  
    
    2 people found this answer helpful.
    0 comments No comments

  2. Michael Luna 16 Reputation points
    2020-12-20T05:56:50.073+00:00

    Thanks. Was a casing problem the @bind-Value.

    2 people found this answer helpful.