Hi,
I'm having some trouble calling a modal popup from server side. So, I set the modalpopupextender's targetcontrolID to a hidden label. Then in the codebehind from a button's click, I try to add this.modalpopup.show(); Unfortunately, the modal popup doesn't appear when this happens. I can see the code get executed, but nothing shows.
Here's my ASP. minus the opening < for the button and popupextender, because for some reason those lines won't display.
<asp:Button CssClass="Button" ID="button" runat="server" Text="Button" AccessKey="m" meta:resourcekey="buttonResource1" OnClick="button_Click" />
<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server" TargetControlID="forpopup"
PopupControlID="PopupPanel" BackgroundCssClass="modalBackground" />
<asp:Label ID="forpopup" runat="server" Visible="False"></asp:Label>
<asp:panel id="PopupPanel" runat="server" BorderStyle="Groove" BorderColor="black" BorderWidth="3px" BackColor="AliceBlue" Height="200px" Width="200px" style="display: none">
<asp:Label ID="lblPopup" runat="server" Text="popup!"></asp:Label><br />
<br />
<asp:DropDownList ID="ddlData" runat="server">
</asp:DropDownList><br />
<br />
<asp:Button ID="btnPopupOK" runat="server" Text="Ok" />
<asp:Button ID="btnPopupCancel" runat="server" Text="Cancel" />
</asp:panel>
and here is my codebehind
protected void button_Click(object sender, EventArgs e)
{
this.mpe.Show();
}