Reputation: 1810
What is the best way to handle multiple popup dialogs in ASP.Net Web Application? Trying I have approx 5+ popup dialogs to show in the main page. currently I am using the ModalPopUpExtender to display the first popup. Do I have to Create a (New Panel and ModalPopUpExtender) for every popup? All this code in the main page would make it very cluttered.
Upvotes: 0
Views: 431
Reputation: 3475
How about having a user control with one modalpopupextender
exposing a public enum property
to set the type of the popup. You can have 5 panels inside that modalpopupextender
whose display/data are controlled by the enum property.
From the main page, you set the enum
property before you call usercontrol.show()
which will in turn call mpe.Show();
after setting the visibility on the appropriate panel.
This way you will only have one user control on the main page and all the pop up logic is contained within it.
Upvotes: 1