problem with field validation rendering when dynamically removing fields

Try this: In the code that iterate a list of stakeholders, at each stakeholder, what ever it is, say a component add the @key directive attribute with a value of the stakeholder itself.

Here’s a code sample to describe the words above:

This code should be in the request form, where you create a list of StakeHolder components…

    @foreach( var holder in stakeHolders)
    {
        <StakeHolder @key="holder" Data="holder"></StakeHolder>

        
    }

   @code
   {
       private List<Stakeholder> stakeHolders;
     
   }

Read about the @key directive attribute here

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top