Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7989579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:47:31+00:00 2026-06-04T12:47:31+00:00

Here’s my situation. I have a web forms page, and it’s getting annoying when

  • 0

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.

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.

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

I understand that I can do some of this with the <triggers> 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.

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.

The Master page:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebApplication1.SiteMaster" %>

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

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

    </div>
    </form>
</body>
</html>

The default page:

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



<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">

</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <asp:Label runat=server Text="This lable represents things not in update panels" ID="label1"></asp:Label>

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

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

    <asp:UpdatePanel ID="UpdatePanelReset" runat=server>
        <ContentTemplate>
            <asp:Button ID="reset" runat="server" OnClick="Reset_click" Text="reset" />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="button1" EventName="click" />
            <asp:AsyncPostBackTrigger ControlID="button2" EventName="click" />
        </Triggers>
    </asp:UpdatePanel>

</asp:Content>

The code behind

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 && !textBox2.Enabled;
        }

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

        protected void Reset_click(object sender, EventArgs e)
        {
            textBox1.Text = "StartText";
            textBox2.Text = "StartText";
            label1.Text = "reset button clicked";
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:47:33+00:00Added an answer on June 4, 2026 at 12:47 pm

    Just add a PostBackTrigger to the last UpdatePanel.

    <asp:PostBackTrigger ControlID="reset" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the basic setup: I have a thin bar at the top of a
Here is my code (Say we have a single button on the page that
Here's my situation: I have a Data Template set up which contains a ToggleButton
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Here is my problem : I have a post controller with the action create.
Here is an example: I have the generic type called Account. I wish to
Here is the problem that I am trying to solve. I have two folders
Here is my code...I have two dimensional matrices A,B. I want to develop the
here's what we have today: * NxM grid of points in 3D * we
Here is what I am trying to achieve in PHP: I have this string:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.