Hi,
i use asp.net and c# to build my web application.
i'm trying to display message dynamically using ModalPopup extender.
I add the event inside a loop and the message is selected according to my logic.
My issue is that the label stays empty, it seems that the set does not take effect, so the popup comes up empty.
the code:
<asp:Panel ID="pnlMsg" runat="server" CssClass="modalPopup" Style="display: none">
<asp:Label ID="lblModalMsg" runat="server" ></asp:Label>
<asp:Button ID="btnOk" runat="server" Text="OK" />
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="hidForModel" PopupControlID="pnlMsg" BackgroundCssClass="modalBackgroud" DropShadow="true" OkControlID="btnOk" Enabled="true"></asp:ModalPopupExtender>
<asp:HiddenField ID="hidForModel" runat="server" />
Server side
private void onImageClick(object sender, EventArgs e)
{
User loggedInUser = (User)Session["user"];
if (loggedInUser == null)
{
lblModalMsg.Text = "User is not connected";
ModalPopupExtender1.Show();
return;
}
else
{
lblModalMsg.Text = "Welcome!";
ModalPopupExtender1.Show();
return;
}
Response.Redirect("NewPage.aspx);
}
the loop
responderPhoto.Click += new ImageClickEventHandler(onImageClick);
Any assistance will be appreciated.
Thanks.