I want a textarea to always show the value of a variable. But it only updates if I click a button. What can I do to update the textarea everytime the variable changes?
<button class="btn btn-primary" @onclick="Test">Test</button>
<textarea type="text" name="configJson" id="configJson" value="@inputString" rows="20" cols="50" />
@code {
private string inputString;
private void Test()
{
inputString = inputString;
}
}
I have code that changes the variable constantly but it does not update the textarea. The textarea is only updated if I click the button. What am I doing wrong? Thanks in advance!