SNIPPETBANK.NET

ASP.Net - ASP.Net C# MessageBox


Modal boxes are great to get a users response. Sometimes, they replace the traditional JavaScript alert and confirm dialogs giving the end user a better experience. But managing modal boxes in code can sometimes be tricky. For example, you may have a modal box, that needs to look and behave differently or give the user options based on certain conditions. For this reason I've developed a C# message box class that can render the markup for a modal box based on templates.
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#
Simple File Upload Asp.Net makes uploading files as simple as a few lines of code. In this article, I explain how to upload files using Web Forms and C#.
Custom MVC Framework If your thinking about developing your own MVC framework in C#, then you can check out this sample MVC Framework that was developed using Asp.Net Web Forms.
ASP.Net C# MessageBox Modal boxes are great to get a users response. Sometimes, they replace the traditional JavaScript alert and confirm dialogs giving the end user a better experience. But managing modal boxes in code ca...