targetcontrolid="btnAdd" popupcontrolid="Panel1"
popupdraghandlecontrolid="PopupHeader" drag="true"
>
targetcontrolid="btnAdd" popupcontrolid="Panel2"
popupdraghandlecontrolid="PopupHeader" drag="true"
>
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit ChoudharyRank #145 · 15.8K reputationPosted Oct 14, 2010, 5:44 AM EDT
add and hidden button on your page and set the targetcontrolID="btn_hidden" for both modal popup.
now in your code behind you can now use the code
if(
{
modalpopupcontorl1.show();
}
else
{
modalpopupcontrol2.show();
}
Please mark "Do you like this post?" if it helps you
Posted Oct 14, 2010, 3:34 AM EDT
https://blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/09/02/controlling-a-ajax-control-modalpopupextender-from-code-behind.aspx
Vikas AhlawatRank #2,648 · 525 reputationPosted Oct 14, 2010, 8:03 PM EDT
I have set targetcontrolid="btnAdd" for both modelpopup
and write the code on btnAdd click event
if (buttonstring == "Category")
{
ModalPopupExtender2.Show();
}
else
{
ModalPopupExtender1.Show();
}
but it show both modal popup
Amit ChoudharyRank #145 · 15.8K reputationPosted Oct 15, 2010, 12:27 AM EDT
Vikas AhlawatRank #2,648 · 525 reputationPosted Oct 15, 2010, 2:12 AM EDT
if (buttonstring == "Category")
{
ModalPopupExtender1.CancelControlID = "ctgcancelcross";
ModalPopupExtender1.PopupControlID = "Panel_Category";
}
else if (buttonstring == "StudentProspects")
{
ModalPopupExtender1.CancelControlID = "spcancelcross";
ModalPopupExtender1.PopupControlID = "Panel_StudentProspects";
}