• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

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
0
eddyperu
Asked:
eddyperu
  • 3
  • 2
1 Solution
 
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:
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:
let me know if you have any questions
0
 
eddyperuAuthor Commented:
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now