title: Using ASP.NET with no models
body: <p>I'm trying to create a single web page that will do calculations using a class library I created. It has 80 or so calculation methods across 10 classes. This class library doesn't have properties. It has classes with methods that have parameters.</p>
  
  <p>I can populate a view with the text boxes I need using reflection. Here's a screen shot:
  <a href="https://i.stack.imgur.com/bil1W.png" rel="nofollow noreferrer">Vogels Formula</a></p>
  
  <p>Here's the code I'm using to create the formula in the screen shot:</p>
  
  <pre><code>    @using OpticianMathLibrary;
      @{
      ViewBag.Title = "Index";
      }
  
      @*Here's where I'm getting the type and method*@
      @{ Type myType = (typeof(BaseCurve));}
      @{ var myMethodInfo = myType.GetMethods();}
      @{ var aMethod = myType.GetMethod("VogelsRulePlus");}
  
  
     @*This is what creates the formula and text boxes*@
     &lt;h1&gt;Formula:&lt;/h1&gt;
     &lt;h2&gt;@aMethod.Name&lt;/h2&gt;
  
     @*Creates text boxes with parameters*@
     @{ var methodParameters = aMethod.GetParameters();}
  
     @{ foreach (var param in methodParameters)
      {
          &lt;h3&gt;@param.Name&lt;/h3&gt;
          @Html.TextBox(param.Name)
  
      }}
      &lt;br /&gt;
      &lt;br /&gt;
  
      @*Temporary values to give the method actual parameters*@
      @{ var sphere = 1.00;}
      @{ var cylinder = -1.00;}
  
      @*Method being created by reflection*@
      @{ var invokeMethod = aMethod.Invoke(aMethod, new object[] { sphere, 
      cylinder});}
  
      @*Button to invoke the method*@
      &lt;input type="button" value="Calculate"  
       onclick="document.getElementById('result').innerText = @invokeMethod" 
       /&gt; 
  
       @*Label to show the results*@
       &lt;h1 id="result"&gt;&lt;/h1&gt;
  </code></pre>
  
  <p>I realize that I'm using a specific class "BaseCurve" and a specific method "VogelsRulePlus". Eventually, those values will actually come from a drop down at the top of the form or something like that. </p>
  
  <p>My question is, how do I hand the forms text box data back to the controller? The number of parameters will usually be different based on what the method needs.</p>
  
  <p>Also, where do I invoke the method I created with reflection? In the controller or the view?</p>
  
  <p>Am I doing too much in the view?</p>
  
  <p>Is the way I'm going about this just generally hosed?</p>
  
  <p>By the way, this is my first asp project. I've only used winforms up until now.</p>
  
  <p>Thanks,
  R</p>