Problems calling a ASP button from Modal a pop up extender

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.

Question:
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

Thanks
LVL 4
eddyperuAsked:
Who is Participating?
 
burakiewiczCommented:
this is a very basic example

aspx
<body>
    <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:Panel>
   <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" />
</form>
</body>
 
.cs--------------------------------------------------------------
 
protected void btnEnableButton_Click(object sender, EventArgs e)
{
   btnThatWasDisabled.Enabled = true;
}

Open in new window

0
 
burakiewiczCommented:
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
0
 
eddyperuAuthor Commented:
Would you mind to send me an example how to do this?
Thanks
0
 
burakiewiczCommented:
let me know if you have any questions
0
 
eddyperuAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.