Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the EditForm's Context property actually do?

The standard EditForm has a Context property. What does this property actually do and how should it be used?

The official docs mention EditContext. There is no mention of Context.

like image 994
Ivan Debono Avatar asked Jun 08 '26 01:06

Ivan Debono


1 Answers

It provides the name you can use to reference the instance of the EditContext the EditForm holds. If you pass in a Model it will also have created it.

In the contrived example below I've added some rather ugly code to show how you could use it.

<EditForm Context="xxx" Model="_model">
    @{
        EditContext mycontext = xxx;
        mycontext.Validate();
    };
</EditForm>
like image 57
MrC aka Shaun Curtis Avatar answered Jun 10 '26 14:06

MrC aka Shaun Curtis