title: C# Creating a calculator using ASP.Net MVC
body: <p>I'm learning mvc and trying to create a simple calculator. I have most of the work done, but i cant seem to work the calculation part using javaScript.
  The result that is displayed in the browser is almost complete and is like that: 5 + 2 = 0.</p>
  
  <p>This is the view where the result of  the calculation will be displayed in the browser, also where i thought the calculation part should be (currect me if i'm wrong): </p>
  
  <pre><code>@model CalculatorWebPage.Models.Calc
  
  @{
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;CalculateResult&lt;/title&gt;
         &lt;script&gt;
          if (@Model.Operator == '+')
          {
              @Model.Result = @Model.FirstNumber + @Model.SecondNumber;
          }
          else if (@Model.Operator == '-')
          {
              @Model.Result = @Model.FirstNumber - @Model.SecondNumber;
          }
          else if (@Model.Operator == '*')
          {
              @Model.Result = @Model.FirstNumber * @Model.SecondNumber;
          }
          else if (@Model.Operator == '/')
          {
              @Model.Result = @Model.FirstNumber / @Model.SecondNumber;
          }
          return @Model.Result;
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          @Model.FirstNumber @Model.Operator @Model.SecondNumber = @Model.Result
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Is this is the place and the way to put the javeScript code to calculate?</p>