I am using ajax modal popup to display the type of error when a user submits a request. The code behind (vb) evaluates if all conditions are met and if not, a message is displayed to the user notifying what is missing. I can't seem to figure out how to set up the message body from the code behind before displaying the modal dialog. This is the code for the dialog I modified from a post in ASP Snippets:
<asp:LinkButton ID="lnkDummy" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mpe" runat="server"
PopupControlID="pnlPopup" TargetControlID="lnkDummy" BackgroundCssClass="modalBackground" CancelControlID = "btnHide" Drag="true">
</cc1:ModalPopupExtender>
<asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none">
<div class="ModalHeader">
Message Title
</div>
<div id="msgBody" class="ModalBody" runat="server">
Message Body
<br /><br />
<asp:Button ID="btnHide" runat="server" Text="OK"/>
</div>
</asp:Panel>
Then in the code behind I try to set up the div text and open the modal dialog:
msgBody.InnerHtml = strMessage
ModalPopupExtender1.Show()
However, nothing shows in the body of the message. I tried adding a text box, label in the message body <div> and assign a value to these elements with no success.