Thoughts on .Net & Coding

.Net Articles, tutorials, reviews, code and more...

  • Load Views From Database in ASP.NET MVC

    ASP.NET MVC organizes view files in the Views folder. This arrangement works fine for most of the applications. However, in some cases you may need to load views from database rather than physical disk file. This article discusses how this can be accomplished.

  • Show Validation Messages Containing Images in ASP.NET MVC

    ASP.NET MVC offers HTML helpers for displaying field level validation error messages as well as validation summary. However, these validation messages are displayed as a plain string. There is no inbuilt way to include images of HTML markup with the output of the validation helpers. In this article I will show how to overcome this limitation using two techniques so that you can display images along with the validation messages.

  • Updated : Creating Wizard in ASP.NET MVC (Part 3 - jQuery)

    In Part 1 and Part 2 of this article series you developed a wizard in an ASP.NET MVC application using full page postback and Ajax helper respectively. In this final part of this series you will develop a client side wizard using jQuery. The navigation between various wizard steps (Next, Previous) happens without any postback (neither full nor partial). The only step that causes form submission to the server is clicking on the Finish wizard button.

  • Updated : Creating Wizard in ASP.NET MVC (Part 2 - Ajax Helper)

    In Part 1 of this article series you developed a wizard in an ASP.NET MVC application. Although the wizard developed in Part 1 works as expected it has one shortcoming. It causes full page postback whenever you click on Previous or Next button. This behavior may not pose much problem if a wizard has only a few steps. However, if a wizard has many steps and each step accepts many entries then full page postback can deteriorate the user experience. To overcome this shortcoming you can add Ajax to the wizard so that only the form is posted to the server. In this part of the series you will convert the application developed in Part 1 to use Ajax.

  • Updated : Creating Wizard in ASP.NET MVC (Part 1 - Full Postback)

    At times you want to accept user input in your web applications by presenting them with a wizard driven user interface. A wizard driven user interface allows you to logically divide and group pieces of information so that user can fill them up easily in step-by-step manner. While creating a wizard is easy in ASP.NET Web Forms applications, you need to implement it yourself in ASP.NET MVC applications. There are more than one approaches to creating a wizard in ASP.NET MVC and this article shows one of them. In Part 1 of this article you will develop a wizard that stores its data in ASP.NET Session and the wizard works on traditional form submission.

  • Validate Model Programmatically in ASP.NET MVC

    ASP.NET model binding framework takes care of validating a model based on data annotation validations. This works well when a model is being bound with request data. However, at times you may need to create and fill a model programmatically. In such cases, although the model properties are decorated with data annotation validators, they won't validate the data because they are not invoked at all. Luckily, ASP.NET MVC allows you to validate a model object via code. This article shows how.

  • Utilize HTML5 DataList and jQuery Ajax to Create Autocomplete in ASP.NET MVC

    In data entry forms involving textboxes with predictable values one can use autocomplete to assist user pick an existing value. HTML5 introduces datalist element that can come handy while implementing autocomplete. The datalist element holds a list of options and can be attached with a textbox using list attribute. By adding a bit of jQuery Ajax you can dynamically populate the options in a datalist. This article shows you how to do just that.