Passing reference object from js to C# and back

Manikanta T P S 1 Reputation point
2020-07-28T17:11:07.637+00:00

I want to pass object by reference from JavaScript to C# and back. Is there any way to do this.

i am using the below code to call the javascript function.

[JSInvokable("ExecuteJS")]
public static async Task<object> ExecuteJS(string value)
{
var result = await jsRuntime.InvokeAsync<object>("somefunction");

//Do some modification

return result
}

Community Center | Not monitored
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.