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 6931921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:38:24+00:00 2026-05-27T11:38:24+00:00

Have an UpdatePanel that contains 2 panels with default buttons set to listen to

  • 0

Have an UpdatePanel that contains 2 panels with default buttons set to listen to enter key presses. That UpdatePanel is the PopupControl for a ModalPopupExtender.

Running into an issue when pressing enter in the modal popup in which the entire page posts back. Any ideas? Here are some code snippets (I’ve removed the extraneous fields…):

<div runat="server" id="divShippingEstimatorPopup" class="shippingEstimatorModalPopup">
<asp:UpdatePanel ID="upPopup" runat="server">
    <ContentTemplate>
        <asp:Panel runat="server" ID="pnlShippingEstimator" DefaultButton="lnkbtnGetEstimates">
            <div class="title content_title">Shipping Estimator</div>
            <asp:Label runat="server" ID="lblMessage" />
            <table cellpadding="0" cellpadding="0" class="shipping">
                <!-- Removed to shorten code snippet -->
                <tr>
                    <td colspan="2">
                        <div class="buttonHolder">                            
                            <Monarch:LinkButtonDefault runat="server" ID="lnkbtnGetEstimates" CssClass="button_action button_margin_right" CausesValidation="false">Get Estimates</Monarch:LinkButtonDefault>
                            <asp:LinkButton runat="server" ID="lnkbtnCancel" CssClass="button_secondary button_secondary_fixed" CausesValidation="false">Cancel</asp:LinkButton>
                            <div class="clear"></div>
                        </div>
                        <div class="clear"></div>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel runat="server" ID="pnlShippingOptions" DefaultButton="lnkbtnSetEstimate">
            <div class="shippingOptionsHolder" runat="server" id="divShippingOptionsHolder">
                <!-- Removed to shorten code snippet -->
                <div class="buttonHolder">
                    <Monarch:LinkButtonDefault runat="server" ID="lnkbtnSetEstimate" CssClass="button_action">Set Estimate</Monarch:LinkButtonDefault>
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
            </div>
        </asp:Panel>
    </ContentTemplate>
</asp:UpdatePanel>

Keep in mind the LinkButtonDefault is just this:

public class LinkButtonDefault : LinkButton
{
    private const string AddClickScript = "SparkPlugs.FixLinkButton('{0}');";

    protected override void OnLoad(EventArgs e)
    {
        string script = String.Format(AddClickScript, ClientID);
        Page.ClientScript.RegisterStartupScript(GetType(), "click_" + ClientID,
            script, true);
        base.OnLoad(e);
    }
}

Finally, here is the rest of the control:

<asp:UpdatePanel runat="server" ID="upGetEstimate">
    <ContentTemplate>
        <asp:LinkButton runat="server" ID="lnkbtnGetEstimate" CausesValidation="false">Get Estimate</asp:LinkButton>
    </ContentTemplate>
</asp:UpdatePanel>

<ajaxToolKit:ModalPopupExtender ID="shippingEstimatorPopupExtender" runat="server" TargetControlID="lnkbtnFake" PopupControlID="divShippingEstimatorPopup" BackgroundCssClass="monarchModalBackground"></ajaxToolKit:ModalPopupExtender>
<asp:LinkButton runat="server" ID="lnkbtnFake" style="display:none;"/>

<Monarch:PopupProgress ID="popupProgressGetEstimate" runat="server" AssociatedUpdatePanelId="upGetEstimate" />
<Monarch:PopupProgress ID="popupProgressGetEstimates" runat="server" AssociatedUpdatePanelId="upPopup" />

Basically, the user clicks Get Estimate, a progress bar appears while it loads the form, the form shows in a modal popup. I’m guessing this is something simple, but I can’t just get the right combination to get this working properly.

  • 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-05-27T11:38:24+00:00Added an answer on May 27, 2026 at 11:38 am

    First of all try what happens if you use your scriptmanager to register script in the code behind.

    I use this method for registering scripts:

    public static void RegisterStartupScript(Control c, string script)
    {
        if ((ToolkitScriptManager.GetCurrent(c.Page) as ToolkitScriptManager).IsInAsyncPostBack)
            ToolkitScriptManager.RegisterStartupScript(c, c.GetType(), "Script_" + c.ClientID.ToString(), script, true);
        else
            c.Page.ClientScript.RegisterStartupScript(c.GetType(), c.ClientID, script, true);
    }
    

    This checks if you have ScriptManager in your page. If it doesn’t, it uses the full postback version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an UpdatePanel that contains a Repeater. in the ItemTemplate of the repeater
I have a simple user control that contains some buttons that fire events which
I have a UserControl that contains an UpdatePanel which wraps some other controls. The
I have a UserControl ('AddressInfoGroup') within an updatepanel that dynamically loads user controls ('AddressInfo')
I have a listing in an UpdatePanel I have some filters for that list
I have a aspx page that has a UpdatePanel and a asp timer. the
I have a drop down list that triggers an updatepanel when the index is
okay? I have a button that is inside an updatepanel, click on this button
Basically, I have created a custom control that uses an UpdatePanel, and as I
I have an ASP.NET 4 webpage that contains an update panel which just allows

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.