refreshing entire page from within an updatepanel
<p>Here's my situation.  I have a web forms page, and it's getting annoying when the entire page scrolls to the top every time you click a control, so I'm trying to apply update panels to my page. </p>

<p>The submit button may or may not be click-able depending on whether or not the contents of individual update panels are in a proper state.  </p>

<p>When the submit button is clicked, It can potentially affect any of the controls on the page.  </p>

<p>I understand that I can do some of this with the <code>&lt;triggers&gt;</code> tag element of the update panel, but I don't want to have to put everything on the page into an update panel with it's own trigger, I'd rather that the submit button just reload the entire page.</p>

<p>For the sake of simplicity I've put together a sample project to represent my page.  It has a "reset" button, to represent the "submit" button.</p>

<p>The Master page:</p>

<pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebApplication1.SiteMaster" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;link href="~/Styles/Site.css" rel="stylesheet" type="text/css" /&gt;
    &lt;asp:ContentPlaceHolder ID="HeadContent" runat="server"&gt;
    &lt;/asp:ContentPlaceHolder&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form runat="server"&gt;
    &lt;asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true"  /&gt;

    &lt;div class="page"&gt;
        &lt;div class="header"&gt;
            &lt;div class="title"&gt;
                &lt;h1&gt;
                    My ASP.NET Application
                &lt;/h1&gt;
            &lt;/div&gt;
            &lt;div class="loginDisplay"&gt;
                &lt;asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"&gt;
                    &lt;AnonymousTemplate&gt;
                        [ &lt;a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server"&gt;Log In&lt;/a&gt; ]
                    &lt;/AnonymousTemplate&gt;
                    &lt;LoggedInTemplate&gt;
                        Welcome &lt;span class="bold"&gt;&lt;asp:LoginName ID="HeadLoginName" runat="server" /&gt;&lt;/span&gt;!
                        [ &lt;asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/&gt; ]
                    &lt;/LoggedInTemplate&gt;
                &lt;/asp:LoginView&gt;
            &lt;/div&gt;
            &lt;div class="clear hideSkiplink"&gt;
                &lt;asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"&gt;
                    &lt;Items&gt;
                        &lt;asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/&gt;
                        &lt;asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/&gt;
                    &lt;/Items&gt;
                &lt;/asp:Menu&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="main"&gt;
            &lt;asp:ContentPlaceHolder ID="MainContent" runat="server"/&gt;
        &lt;/div&gt;
        &lt;div class="clear"&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="footer"&gt;

    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The default page:</p>

<pre><code>&lt;%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %&gt;



&lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt;

&lt;/asp:Content&gt;
&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;

    &lt;asp:Label runat=server Text="This lable represents things not in update panels" ID="label1"&gt;&lt;/asp:Label&gt;

    &lt;asp:UpdatePanel ID="UpdatePanel1" runat=server&gt;
        &lt;ContentTemplate&gt;
            &lt;table&gt;
                &lt;tr&gt;
                    &lt;td&gt;&lt;asp:Button ID="button1" runat="server" OnClick="Button1_click" Text="Button 1" /&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;asp:TextBox ID="textBox1" runat="server" Text="StartText" Enabled="false" /&gt;&lt;/td&gt;
                &lt;/tr&gt;
            &lt;/table&gt;
        &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;

    &lt;asp:UpdatePanel ID="UpdatePanel2" runat=server&gt;
        &lt;ContentTemplate&gt;
            &lt;table&gt;
                &lt;tr&gt;
                    &lt;td&gt;&lt;asp:Button ID="button2" runat="server" OnClick="Button2_click" Text="Button 2" /&gt;&lt;/td&gt;
                    &lt;td&gt;&lt;asp:TextBox ID="textBox2" runat="server" Text="StartText" Enabled="false" /&gt;&lt;/td&gt;
                &lt;/tr&gt;
            &lt;/table&gt;
        &lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;

    &lt;asp:UpdatePanel ID="UpdatePanelReset" runat=server&gt;
        &lt;ContentTemplate&gt;
            &lt;asp:Button ID="reset" runat="server" OnClick="Reset_click" Text="reset" /&gt;
        &lt;/ContentTemplate&gt;
        &lt;Triggers&gt;
            &lt;asp:AsyncPostBackTrigger ControlID="button1" EventName="click" /&gt;
            &lt;asp:AsyncPostBackTrigger ControlID="button2" EventName="click" /&gt;
        &lt;/Triggers&gt;
    &lt;/asp:UpdatePanel&gt;

&lt;/asp:Content&gt;
</code></pre>

<p>The 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.Xml.Linq;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_click(object sender, EventArgs e)
        {
            textBox1.Enabled = !textBox1.Enabled;
            reset.Enabled = !textBox1.Enabled &amp;&amp; !textBox2.Enabled;
        }

        protected void Button2_click(object sender, EventArgs e)
        {
            textBox2.Enabled = !textBox2.Enabled;
            reset.Enabled = !textBox1.Enabled &amp;&amp; !textBox2.Enabled;
        }

        protected void Reset_click(object sender, EventArgs e)
        {
            textBox1.Text = "StartText";
            textBox2.Text = "StartText";
            label1.Text = "reset button clicked";
        }
    }
}
</code></pre>
