Call function in custom component


I have build a custom component which I use it with the HTML component on a page - the component displays a DevExpress Report which works good but now I need to call a method from the page in the component to refresh the report because I pass to dates from the page to the component... (see picture)

how to call a method in the component from my page?

or is it possible to refresh the HTML component if one of the dates changed?

You can use either Invoke Method or Execute C# action to run the required code.

But how to reference the method in the component from the page?

You can add @ref to your component markup pointing to a field decaled in the page partial class. For example:

<MyComponent @ref="myComp" ... 
MyComponent myComp;
1 Like