Refresh contents of View
<p>I use a Multiview to display some Charts.  On first load, the page presents 2 drop downs and a GO button.  I use the Code Behind to choose which View to display based on the selections from the dropdowns.</p>

<p>The page has an AJAX refresh with a Button that allows the user to stop auto-refreshing.  The button disables the Timer, changes the button text, Italicises it and disables the button itself.  This works great.</p>

<p>The user selects their options and hits GO and the requested View displays.  I have not allowed for a way to turn on auto refresh.  Purely out of ease for myself.  I thought the easiest way would be to just allow the user to hit the GO button again (The selections governing the current View are still selected in the dropdowns) which would reload the View with the auto-refresh enabled by default.</p>

<p>Below is the essential code for what I currently have with just one view to demonstrate.</p>

<p>ASP.NET</p>

<pre><code>&lt;asp:Content ID="HeadContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;
    &lt;script type="text/javascript"&gt;
        function SetText(id) {
            if (id.value == "Disable automatic page refresh")
                id.value = "Processing Request ...";
        }
    &lt;/script&gt;
&lt;/asp:Content&gt;

&lt;asp:DropDownList ID="itemDropdown" runat="server"&gt;
            ASP LIST ITEMS
&lt;/asp:DropDownList&gt;
&lt;asp:DropDownList ID="timeDropdown" runat="server"&gt;
            ASP LIST ITEMS
&lt;/asp:DropDownList&gt;
&lt;asp:Button ID="Button1" runat="server" Text="Go" OnClick="Button1_Click" /&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;asp:Label ID="errorLabel" runat="server" CssClass="errorLabel"&gt;&lt;/asp:Label&gt;
&lt;/p&gt;

&lt;asp:MultiView ID="MultiView1" runat="server"&gt;
    &lt;asp:View ID="View1" runat="server"&gt;
        &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" ViewStateMode="Enabled" UpdateMode="Conditional"&gt;
            &lt;ContentTemplate&gt;
                &lt;asp:Button ID="Button2" runat="server" Text="Disable automatic page refresh" OnClick="Button2_Click" OnClientClick="return SetText(this)" /&gt;&lt;/p&gt;
        CONTENT HERE
            &lt;/ContentTemplate&gt;
            &lt;Triggers&gt;
                &lt;asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /&gt;
            &lt;/Triggers&gt;
        &lt;/asp:UpdatePanel&gt;
        &lt;asp:Timer ID="Timer1" runat="server" Interval="60000"&gt;
        &lt;/asp:Timer&gt;
    &lt;/asp:View&gt;
</code></pre>

<p>CODE BEHIND</p>

<pre><code>protected void Button1_Click(object sender, EventArgs e)
{    
    if (errorLabel.Text != null)
    {
        errorLabel.Text = string.Empty;
    }

    if (itemDropdown.SelectedValue == "5" &amp;&amp; timeDropdown.SelectedValue == "0.5")
    {
        MultiView1.ActiveViewIndex = 0;
        UpdatePanel1.Update();
    }
    IF CONTINUES ...
    else
    {
        errorLabel.Text = "You did not choose a valid Item or Timeframe.  Please try again.";
    }
}

protected void Button2_Click(object sender, EventArgs e)
{
    Timer1.Enabled = false;
    Button2.Text = "Automatic Refresh Disabled";
    Button2.Font.Italic = true;
    Button2.Enabled = false;
}
</code></pre>

<p>My issue is that when I click the GO button, the updated button conditions are still in place.  ie. The name is changed, italicized and disabled.  Is there a way to force a View to completely reload?  I hope this makes sense.  I tried UpdatePanel1.Update(); as can be seen above in the Button1_Click method but it didn't work.</p>

<p>Using Ann L's suggestion, I tried the following but none would work:</p>

<pre><code>protected void Button2_Click(object sender, EventArgs e)
{
    Timer1.Enabled = false;
    Button2.Text = "Automatic Refresh Disabled";
    Button2.Font.Italic = true;
    Button2.Enabled = false;

    Timer1.Enabled = true;
    Timer1.Interval = 10000;
    Button2.Text = "Disable automatic page refresh";
    Button2.Font.Italic = false;
    Button2.Enabled = true;
}

protected void Button2_Click(object sender, EventArgs e)
{
    Timer1.Enabled = true;
    Timer1.Interval = 10000;
    Button2.Text = "Disable automatic page refresh";
    Button2.Font.Italic = false;
    Button2.Enabled = true;     

    Timer1.Enabled = false;
    Button2.Text = "Automatic Refresh Disabled";
    Button2.Font.Italic = true;
    Button2.Enabled = false;
}

protected void Button2_Click(object sender, EventArgs e)
{
    if (!Button2.Enabled)
    {
        Timer1.Enabled = true;
        Timer1.Interval = 10000;
        Button2.Text = "Disable automatic page refresh";
        Button2.Font.Italic = false;
        Button2.Enabled = true;
    }
    else
    {
        Timer1.Enabled = false;
        Button2.Text = "Automatic Refresh Disabled";
        Button2.Font.Italic = true;
        Button2.Enabled = false;
        Button2.ToolTip = "Click again to resume automatic refresh";
    }
}
</code></pre>

<p>To solve this issue I put the following in to my Code Behind:</p>

<pre><code>protected void Button2_Click(object sender, EventArgs e)
{
    if (Button2.Text == "Disable automatic page refresh")
    {
        Timer1.Enabled = false;
        Button2.Text = "Automatic Refresh Disabled";
        Button2.Font.Italic = true;
        Button2.ToolTip = "Click again to resume automatic refresh";
    }
    else
    {
        Timer1.Enabled = true;
        Timer1.Interval = 10000;
        Button2.Text = "Disable automatic page refresh";
        Button2.Font.Italic = false;
        Button2.ToolTip = "Click to disable automatic page refresh";
    }
}
</code></pre>
