The MessageBox class can be used to add a custom modal box to your application. Because it's template based, you can use any existing modal box library. For example you can use Twitters modal box from the bootstrap. The class, allows you to configure the template, allowing you to set the modal box's title, message and buttons . You can even add your own custom variables on the template and use the class to assign it values.
Using this approach means, you can render only the modal box elements you need. Consider this scenario, you have an MVC application, where one view is shared between several actions. Your view has a modal box markup but the modal box, needs to show different options based on which controller action is invoking the view. Using the MessageBox class, you can configure the modal box from the action method and render it on the view.
Download For C#