I have a ModalPopupExtender that I just want to use as a status popup when there are multi-year background tasks.
<script language="javascript" type="text/javascript"> function ShowInfoPopup(Caption, Message) { $find("<%= tcPopUpCaption.ClientID %>").innerHTML = Caption; $find("<%= tcPopUpMessage.ClientID %>").innerHTML = Message; $find("<%= mpe.ClientID %>").Show(); } </script> <asp:LinkButton runat="server" ID="btnPopup" /> <asp:Panel ID="pnlInfoPopup" runat="server" Style="display: none;" Width="350px" CssClass="InfoPopup_Panel"> <asp:Table ID="Table1" runat="server" CssClass="InfoPopup_Layout" Style="margin-bottom: 0px"> <asp:TableRow CssClass="InfoPopup_ActionRow"> <asp:TableCell BorderStyle="None"> <asp:Button ID="btnClose" runat="server" Text="x" ToolTip="Close" BorderStyle="Outset" UseSubmitBehavior="false" OnCommand="doCommand" CommandName="ClosePopUp" /> </asp:TableCell> </asp:TableRow> <asp:TableHeaderRow Style="border-bottom: thick solid white"> <asp:TableHeaderCell ID="tcPopUpCaption" Width="100%" BorderStyle="None" runat="server" Text="Popup Caption" /> </asp:TableHeaderRow> <asp:TableRow> <asp:TableCell Width="50%" BorderStyle="None" runat="server" ID="tcPopUpMessage" ClientIDMode="Static" Text="Popup Message" /> </asp:TableRow> </asp:Table> </asp:Panel> <asp:ModalPopupExtender ID="mpe" runat="server" PopupControlID="pnlInfoPopup" BackgroundCssClass="mpeBackground" DropShadow="true" TargetControlID="btnPopup" /> <asp:Button ID="btnS" runat="server" Text="Send" OnCommand="doCommand" CommandName="send" UseSubmitBehavior="false" Width="100px" Height="45px" ClientIDMode="Static" OnClientClick="ShowInfoPopup('Please wait...', 'Sending...')" /> <asp:Button ID="btnL" runat="server" Text="Load" OnCommand="doCommand" CommandName="load" UseSubmitBehavior="false" Width="100px" Height="45px" ClientIDMode="Static" OnClientClick="ShowInfoPopup('Just a sec...', 'Loading...')" />
When the user clicks on one of the buttons (this is just an example scenario), he displays a pop-up window with the caption and message relavant, and then performs a normal Postback to perform a (long) task.
However, in the "ShowInfoPopup" script, $ find for the header and message fails because it cannot find the controls, it returns NULL.
Any suggestions are welcome.
source share