Problems calling a ASP button from Modal a pop up extender

Posted on 2009-02-10
Last Modified: 2012-06-22
Hi Experts
I have two asp buttons in myPage.aspx  Button1 and Button2.
In the  Button2 I  have set the attribute "enable" to false---->  "enable=false".

Now, When I click the Button1 a Modal pop up extender will pop up showing some text and a OkButton.

How can I  change the Button2 attribute  (enable="false" to "enable="true") using the click event from the button "OKButton" in the Modal Pop Up exnteder  ?
If you can show me with an example will be great. I am new in coding with C# and Ajax

Question by:eddyperu
    LVL 16

    Expert Comment

    just add a standard asp button to the modal popup but dont set it as the ok button and in its event handler put the code to change the enabled state
    LVL 4

    Author Comment

    Would you mind to send me an example how to do this?
    LVL 16

    Accepted Solution

    this is a very basic example

        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Panel ID="pnlPopup" runat="server">
            <asp:Button ID="btnEnableButton" runat="server" Text="EnableButton" OnClick="btnEnableButton_Click" />
       <asp:Button ID="btnToShowPopup" runat="server" Text="ShowPopup" />
       <asp:Button ID="btnThatWasDisabled" runat="server" Text="Disable/Enable" Enabled="false" />
        <ajax:modalpopupextender RepositionMode="RepositionOnWindowResizeAndScroll"  
            ID="mpeEnableButton" runat="server" PopupControlID="pnlPopup"
            TargetControlID="btnToShowPopup" BackgroundCssClass="popupBG" />
    protected void btnEnableButton_Click(object sender, EventArgs e)
       btnThatWasDisabled.Enabled = true;

    Open in new window

    LVL 16

    Expert Comment

    let me know if you have any questions
    LVL 4

    Author Closing Comment


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now