I'm doing some testing with Blazor and wanted to take a string and simply change it to uppercase as follows:
@page "/InputBindingTest"
<h1>Binding examples...</h1>
<hr />
<h2>Text input example:</h2>
<p>Firing the 'oninput' event for each key press</p>
<input type="text" bind-value-oninput="@CurrentText" />
<p>Current value is: @CurrentText</p>
<p>Here it is again in UPPERCASE: @CurrentText.ToUpper()</p>
<h2>Checkbox example:</h2>
<input name="check1" type="checkbox" bind-value-onchange="@CurrentSetting" />
<label for="check1">@CurrentSetting</label>
@functions {
private string CurrentText { get; set; }
private bool CurrentSetting { get; set; }
}
Everything works except the ToUpper method on the string. Web Assembly takes a nasty dive:
WASM: Unhandled exception rendering component
I suppose this can't be done (yet) or am I doing something wrong?