TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ghislain
NA
1
1.4k
Multiple ModalPopunExtender
Dec 19 2011 8:20 AM
Hi,
I would like to handler multiple ModalPopunExtender, Login and CreateAccount links, those open MPE each one, as below:
<Ajax:ModalPopupExtender ID="mpeLogin" runat="server"
TargetControlID="lnkLoggin"
PopupControlID="pnlLogin"
DropShadow="true"
BackgroundCssClass="backgroundColorPopup">
</Ajax:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlLogin" CssClass="backgroundColorPanelPopup">
<UC:Login runat="server" ID="UCLogin" />
</asp:Panel>
<Ajax:ModalPopupExtender ID="mpeControlSubscripter" runat="server"
TargetControlID="lnkCreateAccount"
PopupControlID="pnlSubscription"
DropShadow="true"
BackgroundCssClass="backgroundColorPopup">
</Ajax:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlSubscription" CssClass="backgroundColorPanelPopup">
<UC:SubscriptionChoice runat="server" ID="UCSubscriptionChoice" />
</asp:Panel>
Login MPe is working fine but CreateAccount MPE open an User control which contains one form (radiobuttonlist RBL). When you pick an item and submit form, I would like to display others MPE which correspond to the choice of the user in the RBL as below:
<Ajax:ModalPopupExtender ID="mpeFirstLogin" runat="server"
TargetControlID="btnSubmit"
PopupControlID="pnlFirstLogin"
DropShadow="true"
BackgroundCssClass="backgroundColorPopup">
</Ajax:ModalPopupExtender>
<Ajax:ModalPopupExtender ID="mpeCreateAccount" runat="server"
TargetControlID="btnSubmit"
PopupControlID="pnlCreateAccount"
DropShadow="true"
BackgroundCssClass="backgroundColorPopup">
</Ajax:ModalPopupExtender>
<asp:Panel runat="server" ID="pnlSubscriptionWindow">
<asp:Button runat="server" Text="Fermer" ID="CloseWindows"
onclick="CloseWindows_Click" />
<br />
<asp:Label ID="Label1" runat="server">Vous n'êtes pas inscrit</asp:Label>
<br />
<br />
<asp:Panel runat="server" ID="pnSubscriptionChoice" GroupingText="Choississez parmi les options suivantes: ">
<asp:RadioButtonList runat="server" ID="rblTypeSubscription">
<asp:ListItem Value="1">
Vous êtes déjà abonné au magazine papier et Web. Vous pouvez vous inscrire avec votre numéro d'abonné.
</asp:ListItem>
<asp:ListItem Value="2">
Vous êtes déjà abonné au magazine papier. Vous pouvez vous inscrire avec votre numéro d'abonné.
</asp:ListItem>
<asp:ListItem Value="3">
Vous êtes déjà abonné au magazine Web. Vous pouvez vous inscrire avec votre numéro d'abonné.
</asp:ListItem>
<asp:ListItem Value="4">
Vous n'êtes pas abonné et vous souhaitez accéder aux services payant du site.
</asp:ListItem>
<asp:ListItem Value="5">
Vous n'êtes pas abonné et vous souhaitez accéder aux services gratuit du site.
</asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator runat="server" ControlToValidate="rblTypeSubscription" ErrorMessage="*" ValidationGroup="ValidChoice">
</asp:RequiredFieldValidator>
</asp:Panel>
<br />
<asp:Button runat="server" ID="btnSubmit" Text="Valider" ValidationGroup="ValidChoice"
OnClick="btnSubmit_Click" />
<asp:LinkButton runat="server" ID="lbFirstLogin" Visible="false"></asp:LinkButton>
<asp:LinkButton runat="server" ID="lbCreateAccount" Visible="false"></asp:LinkButton>
</asp:Panel>
<asp:Panel runat="server" ID="pnlFirstLogin" CssClass="backgroundColorPanelPopup">
<UC:FirstLogin runat="server" ID="UCFirstLogin" />
</asp:Panel>
<asp:Panel runat="server" ID="pnlCreateAccount" CssClass="backgroundColorPanelPopup">
<UC:CreateAccount runat="server" ID="UCCreateAccount" />
</asp:Panel>
It almost work with that code behind but when I submit the RBL form, MPE disappears and when I click again on the CreateAccount link, it displays directly the right MPE (not RBL form):
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pnlSubscriptionWindow.Visible = true;
pnlFirstLogin.Visible = false;
pnlCreateAccount.Visible = false;
}
else
{
pnlSubscriptionWindow.Visible = false;
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
switch (rblTypeSubscription.SelectedValue)
{
case "1":
case "2":
case "3":
pnlFirstLogin.Visible = true;
pnlCreateAccount.Visible = false;
mpeFirstLogin.Show();
break;
case "4":
//TODO voir ce qu'il faut faire
break;
case "5":
pnlCreateAccount.Visible = true;
pnlFirstLogin.Visible = false;
mpeCreateAccount.Show();
break;
default:
pnlSubscriptionWindow.Visible = true;
break;
}
}
I hope I've been clear in my explanations.
Reply
Answers (
0
)
Calendar Control in Ajax
Service Reference in AJAX