title: Does not exist in current context
body: <p>I have the below code:</p>
  
  <p>CODE BEHIND:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Web.UI.DataVisualization.Charting;
  
  namespace TestApp2
  {
      public partial class hookload : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
              if (Request.QueryString["Rig_ID"].Equals(1))
                  MultiView1.ActiveViewIndex = 0;
              else if (Request.QueryString["Rig_ID"].Equals(2))
                  MultiView1.ActiveViewIndex = 1;
              else if (Request.QueryString["Rig_ID"].Equals(3))
                  MultiView1.ActiveViewIndex = 2;
              else if (Request.QueryString["Rig_ID"].Equals(4))
                  MultiView1.ActiveViewIndex = 3;
              else if (Request.QueryString["Rig_ID"].Equals(5))
                  MultiView1.ActiveViewIndex = 4;
          }
      }
  }
  </code></pre>
  
  <p>And this is my aspx file:</p>
  
  <pre><code>&lt;%@ Page Title="Shannons Proof of Concept Rig Dashboard" Language="C#" MasterPageFile="~/Site.master"
      AutoEventWireup="true" CodeBehind="hookload.aspx.cs" Inherits="TestApp2._Default" %&gt;
  
  &lt;%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
      Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %&gt;
  
  &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
      &lt;asp:MultiView ID="MultiView1" runat="server"&gt;
          &lt;asp:View ID="View1" runat="server"&gt;
              &lt;asp:SqlDataSource ID="SqlDataSource27" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RigDashConnectionString1 %&gt;"
                  SelectCommand="SELECT TOP (30) tbl_rig.name, tbl_stats.Timestamp AS Expr1, tbl_stats.HookLoad, tbl_stats.Rig_ID FROM tbl_rig INNER JOIN tbl_stats ON tbl_rig.rig_id = tbl_stats.Rig_ID WHERE (tbl_stats.Rig_ID = 2) ORDER BY Expr1 DESC"&gt;
              &lt;/asp:SqlDataSource&gt;
              &lt;h2&gt;
                  Rig Hook Load Stats - Previous 10 minutes&lt;/h2&gt;
              &lt;p&gt;
                  &lt;asp:Chart ID="Chart25" runat="server" DataSourceID="SqlDataSource27" Width="900px"
                      Height="500px" Style="margin-top: 5px" Palette="EarthTones"&gt;
                      &lt;Series&gt;
                          &lt;asp:Series Name="Rig 24 Hook Load" XValueMember="Expr1" XValueType="Time" YValueMembers="HookLoad"
                              Legend="Legend" YValuesPerPoint="1" ChartType="Line"&gt;
                          &lt;/asp:Series&gt;
                      &lt;/Series&gt;
                      &lt;ChartAreas&gt;
                          &lt;asp:ChartArea Name="ChartArea1"&gt;
                              &lt;Area3DStyle Enable3D="True" LightStyle="Realistic" WallWidth="0" /&gt;
                          &lt;/asp:ChartArea&gt;
                      &lt;/ChartAreas&gt;
                      &lt;Legends&gt;
                          &lt;asp:Legend Name="Legend" Title="Legend"&gt;
                          &lt;/asp:Legend&gt;
                      &lt;/Legends&gt;
                  &lt;/asp:Chart&gt;
              &lt;/p&gt;
          &lt;/asp:View&gt;
          &lt;asp:View runat="server"&gt;
              &lt;asp:SqlDataSource ID="SqlDataSource28" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RigDashConnectionString1 %&gt;"
                  SelectCommand="SELECT TOP (30) tbl_rig.name, tbl_stats.Timestamp AS Expr1, tbl_stats.HookLoad, tbl_stats.Rig_ID FROM tbl_rig INNER JOIN tbl_stats ON tbl_rig.rig_id = tbl_stats.Rig_ID WHERE (tbl_stats.Rig_ID = 3) ORDER BY Expr1 DESC"&gt;
              &lt;/asp:SqlDataSource&gt;
              &lt;h2&gt;
                  Rig Hook Load Stats - Previous 10 minutes&lt;/h2&gt;
              &lt;p&gt;
                  &lt;asp:Chart ID="Chart26" runat="server" DataSourceID="SqlDataSource28" Width="900px"
                      Height="500px" Style="margin-top: 5px" Palette="EarthTones"&gt;
                      &lt;Series&gt;
                          &lt;asp:Series Name="Rig 21 Hook Load" XValueMember="Expr1" XValueType="Time" YValueMembers="HookLoad"
                              Legend="Legend" YValuesPerPoint="1" ChartType="Line"&gt;
                          &lt;/asp:Series&gt;
                      &lt;/Series&gt;
                      &lt;ChartAreas&gt;
                          &lt;asp:ChartArea Name="ChartArea1"&gt;
                              &lt;Area3DStyle Enable3D="True" LightStyle="Realistic" WallWidth="0" /&gt;
                          &lt;/asp:ChartArea&gt;
                      &lt;/ChartAreas&gt;
                      &lt;Legends&gt;
                          &lt;asp:Legend Name="Legend" Title="Legend"&gt;
                          &lt;/asp:Legend&gt;
                      &lt;/Legends&gt;
                  &lt;/asp:Chart&gt;
              &lt;/p&gt;
          &lt;/asp:View&gt;
          &lt;asp:View runat="server"&gt;
              &lt;asp:SqlDataSource ID="SqlDataSource29" runat="server" ConnectionString="&lt;%$ ConnectionStrings:RigDashConnectionString1 %&gt;"
                  SelectCommand="SELECT TOP (30) tbl_rig.name, tbl_stats.Timestamp AS Expr1, tbl_stats.HookLoad, tbl_stats.Rig_ID FROM tbl_rig INNER JOIN tbl_stats ON tbl_rig.rig_id = tbl_stats.Rig_ID WHERE (tbl_stats.Rig_ID = 5) ORDER BY Expr1 DESC"&gt;
              &lt;/asp:SqlDataSource&gt;
              &lt;h2&gt;
                  Rig Hook Load Stats - Previous 10 minutes&lt;/h2&gt;
              &lt;p&gt;
                  &lt;asp:Chart ID="Chart27" runat="server" DataSourceID="SqlDataSource29" Width="900px"
                      Height="500px" Style="margin-top: 5px" Palette="EarthTones"&gt;
                      &lt;Series&gt;
                          &lt;asp:Series Name="Rig 22 Hook Load" XValueMember="Expr1" XValueType="Time" YValueMembers="HookLoad"
                              Legend="Legend" YValuesPerPoint="1" ChartType="Line"&gt;
                          &lt;/asp:Series&gt;
                      &lt;/Series&gt;
                      &lt;ChartAreas&gt;
                          &lt;asp:ChartArea Name="ChartArea1"&gt;
                              &lt;Area3DStyle Enable3D="True" LightStyle="Realistic" WallWidth="0" /&gt;
                          &lt;/asp:ChartArea&gt;
                      &lt;/ChartAreas&gt;
                      &lt;Legends&gt;
                          &lt;asp:Legend Name="Legend" Title="Legend"&gt;
                          &lt;/asp:Legend&gt;
                      &lt;/Legends&gt;
                  &lt;/asp:Chart&gt;
              &lt;/p&gt;
          &lt;/asp:View&gt;
      &lt;/asp:MultiView&gt;
      &lt;p&gt;
          &lt;a href="..\default.aspx"&gt;&lt; Go Back&lt;/a&gt;
      &lt;/p&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Now my problem is that when I try to run this, I get the message 'The name 'MultiView1' does not exist in the current context'.  I really don't understand why I am getting this error, but I am also a noob so it isn't surprising.  :)  Basically, I have a asp:gridview table on the first page and I am trying to pass parameters to then be processed by this page so when someone clicks the link for ~\charts\hookload.aspx?Rig_ID=2, it processes MultiView Index 1 so it displays a chart of relevant data as described by the SQL Query.</p>
  
  <p>This has been the only way I have found so far to do this so if anyone else has a better idea, believe me I am all ears.  I have struggled to locate an answer to this, mainly because I don't know what keywords to search for.  Any help would be appreciated.</p>