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

  • Home
  • SEARCH
  • 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 745187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:03:56+00:00 2026-05-14T09:03:56+00:00

I’m working on a simple demo project so that I can learn some things

  • 0

I’m working on a simple demo project so that I can learn some things about ASP.NET’s AJAX capabilities. My problem is that I can’t seem to get an UpdatePanel to work properly with a CheckBox inside of it. Here is the markup I’m using in my .aspx file:

<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="UpdatePanel.aspx.cs" Inherits="Testing.UpdatePanel" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title></title>
        <style type="text/css">
            td
            { 
                font-family:Arial;
                font-size:10pt;
            } 
            #mainTable
            {
                background-color:#e3f3ff;
                border:3px;
                border-color:#000000;
                border-style:solid;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <center>
                    <table id="mainTable">
                        <tr><td>&nbsp;</td></tr>

                        <asp:ScriptManager ID="SM1" runat="server" />
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <tr>
                                    <td><asp:CheckBox ID="chkPaypal" runat="server" Text="Paypal" OnCheckedChanged="PayPal_CheckedChanged" AutoPostBack="true" /></td>
                                </tr>
                                <asp:Panel ID="pnlPayPal" runat="server" Visible="false">
                                    <tr>
                                        <td>&nbsp;&nbsp;<asp:Label runat="server" ID="lblPaypalEmail" Text="Email:" /></td>
                                        <td><asp:TextBox runat="server" ID="tbPaypalEmail" Text="" Width="250px" /></td>
                                    </tr>
                                    <tr><td>&nbsp;</td></tr>
                                </asp:Panel>
                            </ContentTemplate>
                            <Triggers>
                                <asp:ASyncPostBackTrigger ControlID="chkPayPal" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <tr><td>&nbsp;</td></tr>
                        <tr>
                            <td colspan="2">
                                <center>
                                    <asp:Button ID="btnRegister" runat="server" onclick="btnRegister_Click" 
                                        Text="Register" Height="30px" Width="80px" />
                                </center>
                            </td>
                        </tr>
                        <tr><td>&nbsp;</td></tr>
                    </table>
                </center>
            </div>
        </form>
    </body>
</html>

In my code behind, I have:

using System;

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

        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {

        }

        protected void PayPal_CheckedChanged(object sender, EventArgs e)
        {
            pnlPayPal.Visible = chkPaypal.Checked;
        }
    }
}

Instead of making the panel visible as I anticipate, it is adding another “PayPal” checkbox at the top of the page. Any ideas?

  • 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-14T09:03:57+00:00Added an answer on May 14, 2026 at 9:03 am

    First thing I can see is you don’t need the Triggers setup to look at your CheckBox since the CheckBox is in the UpdatePanel. You only need to use Triggers when you want the UpdatePanel to refresh based on something outside of it.

    I have taken your code as is and tested it and cannot recreate your problem so there must be more going on. Can you supply more code? Maybe just above it where the table is being defined?

    EDIT: I think the problem is your Panel is defined in a table which is rendering a div between your tr tags. You shoudn’t do that because your making some wackey tables. Change your code to:

    <asp:ScriptManager ID="SM1" runat="server" /> 
    <table>
        <tr>
            <td><asp:CheckBox ID="chkPaypal" runat="server" Text="Paypal" OnCheckedChanged="PayPal_CheckedChanged" AutoPostBack="true" /></td> 
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> 
        <Triggers> 
            <asp:ASyncPostBackTrigger ControlID="chkPayPal" /> 
        </Triggers>        
        <ContentTemplate> 
            <asp:Panel ID="pnlPayPal" runat="server" Visible="false"> 
                <table>
                    <tr> 
                        <td>&nbsp;&nbsp;<asp:Label runat="server" ID="lblPaypalEmail" Text="Email:" /></td> 
                        <td><asp:TextBox runat="server" ID="tbPaypalEmail" Text="" Width="250px" /></td> 
                    </tr> 
                    <tr><td>&nbsp;</td></tr>
                </table>
            </asp:Panel> 
        </ContentTemplate>             
    </asp:UpdatePanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.