Manipulating a control in a child from the parent page
<p>The answer is probably obvious but I have not seen anything I could use except the opposite - manipulating the parent from the child - so I'm posting new.</p>

<p>I have a shopping cart system I'm working on that my company purchased and I'm new to .NET so I may not even ask this properly.</p>

<p>My store has a page in the checkout portion that looks basically like this:</p>

<p>PaymentPage.ascx:</p>

<pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="PaymentPage.ascx.cs" Inherits="ConLib_PaymentPage" %&gt;
&lt;%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %&gt;
&lt;%@ Register Src="~/Checkout/PaymentForms/CreditCardPaymentForm.ascx" TagName="CreditCardPaymentForm" TagPrefix="uc" %&gt;
&lt;ajax:UpdatePanel ID="PaymentAjax" runat="server"&gt;
    &lt;ContentTemplate&gt;

            On page controls, etc.
            Then a checkbox saying they've read the terms and agree:
    &lt;div id="terms"&gt;
        &lt;asp:CheckBox ID="AgreeTerms" runat="server" Text="I agree to the Terms Of Service" CssClass="Terms" AutoPostBack="True" OnCheckedChanged="AgreeTerms_Clicked"/&gt;
    &lt;/div&gt;
</code></pre>

<p>The task I want to accomplish is in the OnCheckedChanged event I want to enable or disable an imagebutton inside the CreditCardPaymentForm control.</p>

<p>That code looks like this:          </p>

<pre><code>&lt;%@ Control Language="C#" ClassName="CreditCardPaymentForm" EnableViewState="false" %&gt;
&lt;%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls" TagPrefix="cb" %&gt;
&lt;%@ Register assembly="wwhoverpanel" Namespace="Westwind.Web.Controls" TagPrefix="wwh" %&gt;

... a &lt;script&gt; block with some code and then HTML

&lt;span class="TTAActionButton"&gt;
    &lt;br&gt;
    &lt;asp:ImageButton ID="CreditCardButton" runat="server" ToolTip="Pay With Card" SkinID="TTAPlaceOrder" OnClick="CreditCardButton_Click" /&gt;
    &lt;asp:HiddenField runat="server"  ID="FormIsSubmitted" value="0" /&gt;
    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;
</code></pre>

<p>I want to be able to turn the CreditCardButton on and off depending on whether the checkbox is checked.  I would have a routine in the page codebehind like:</p>

<pre><code>public void AgreeTerms_Clicked(object sender, EventArgs e)
{
    if (AgreeTerms.Checked)
        CreditCardButton.Enabled = false;
}
</code></pre>

<p>but every permutation of that I try has failed.  </p>

<p>I have abbreviated the code but if I've left out too much please let me know.</p>

<p>Thanks for your help and if you assume I know nothing about .NET then double-thanks!
Jim</p>
