title: Razor pages, detect text changes in textview
body: <p>I have a razor page where the user can make some options from a dropdownlist and than enter some value.
  See attached image</p>
  <p><a href="https://i.stack.imgur.com/9McLW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9McLW.png" alt="enter image description here" /></a></p>
  <p>What i want to achieve is that as user change any of the textboxes, call the appropriate handler function.
  So as soon user enter some value in the textfield 1, the one to the right of textlabel &quot;Some value&quot; i want to do some calculation and update the textfield 2, the one to the right of textlabel &quot;Some other value&quot; . And vice versa for the other textfield.
  I have following code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>@page
  @model CurrencyConverter.Pages.ConvertModel
  @{
      ViewData["Title"] = "Convert";
  }
  
  
  
  &lt;div&gt;
      @if (!string.IsNullOrEmpty(Model.ResultInfo))
      {
          &lt;p&gt;@Model.ResultInfo&lt;/p&gt;
      }
  
  
  
  &lt;/div&gt;
  
  &lt;form method="post"&gt;
      &lt;div&gt;
          @Html.DropDownListFor(m =&gt; m.CurencyModel.FirstCurrency, new SelectList(Model.Options, "Value", "Text"), "Select currency", new { @class = "css-class" })
  
          &lt;input asp-for="CurencyModel.TotalAmountFirstCurrency" /&gt;
      &lt;/div&gt;
      &lt;div&gt;
          @Html.DropDownListFor(m =&gt; m.CurencyModel.SecondCurrency, new SelectList(Model.Options, "Value", "Text"), "Select currency", new { @class = "css-class" })
          &lt;input asp-for="CurencyModel.TotalAmounSecondCurrency" /&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;button type="submit" asp-page-handler="FirstCurrency"&gt;Submit first currency&lt;/button&gt;
          &lt;button type="submit" asp-page-handler="SecondCurrency"&gt;Submit second currency&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  
  the cshtml.cs file looks like this</p>
  <p>public class ConvertModel : PageModel
  {</p>
  <pre><code>[TempData]
  public string ResultInfo { get; set; }
  
  [BindProperty]
  public CurrencyModel CurencyModel { get; set; }
  
  [BindProperty]
  public IEnumerable&lt;SelectListItem&gt; Options
  {
      get; set;
  }
  
  
  public ConvertModel()
  {
      //initalization
  }
  public async Task&lt;IActionResult&gt; OnPostFirstCurrency()
  {
      if(!ModelState.IsValid)
      {
          return Page();
      }
      //given first currency calculate the second from the first using some formula
      
           
  }
  
  public async Task&lt;IActionResult&gt; OnPostSecondCurency()
  {
      if (!ModelState.IsValid)
      {
          return Page();
      }
      //given second currency calculate the second from the first using some formula
  }
  </code></pre>
  <p>}</p>
  <p>what i want to achieve is in</p>
  <pre><code>&lt;div&gt;
  @Html.DropDownListFor(m =&gt; m.CurencyModel.SecondCurrency, new SelectList(Model.Options, &quot;Value&quot;, &quot;Text&quot;), &quot;Select currency&quot;, new { @class = &quot;css-class&quot; })
  &lt;input asp-for=&quot;CurencyModel.TotalAmounSecondCurrency&quot; onchanged=asp-page-handler=&quot;FirstCurrency&quot;/&gt;
  </code></pre>
  
  But this seems not possible with only pure razor and c# syntax.