title: How can I add into a Razor View a panel created from code behind ext.NET (MVC)
body: <p>I want to create an ext.NET Panel in a back-end class somewhere in my project.  Then, inside a razor view, I want to instantiate this class and use it to place the component to the screen.  I need help with this latter part!</p>
  
  <p>For example, I have the class:</p>
  
  <pre><code>namespace Interface.Resources
  {
  
      public class Screen
      {
  
          public ext.Panel NavigationPanel()
          {
              ext.Panel navPanel = new ext.Panel
              {
                  Title = "NAVIGATION",
                  Border = true,
                  Header = false,
                  Region = ext.Region.East,
                  Width = 400,
                  Collapsible = true,
                  CollapseMode = ext.CollapseMode.Mini,
                  Split = true
              };
  
              return navPanel;
  
          }
  ....
  </code></pre>
  
  <p>Now, the view class looks something like this...</p>
  
  <pre><code>@using Interface.Resources
  
  @functions
  {
      Interface.Resources.Screen _irs = new Interface.Resources.Screen();
  }
  
  @_irs.NavigationPanel()
  
  ....
  </code></pre>
  
  <p>Clearly the latter is not working... it compiles and runs, but I get an error.  What am I doing wrong... I have tried using Html.X() etc., but I can't seem to get the panel to render.</p>
  
  <p>Note: If I use something like Html.X().Panel()....Items(items => { items.add(_irs.NavigationPanel()); }) ... it works, but I don't want to have to create the container Panel in the razor view every time I use the Interface Resource library that I am creating.</p>
  
  <p>I appreciate that this issue is not Razor specific.</p>