Posts Tagged ‘ASP.NET’

ASP.NET MVC 3 & Unity 2.0: Using XML configuration for design-time configuration

Introduction In one of my blog post “ASP.NET MVC 3: Dependency injection with Unity 2.0” I explained how to use the Unity 2.0 dependency injection (DI) container in an ASP.NET MVC 3 web application. The example shown in this previous post uses run-time configuration to set up the DI container. A drawback of run-time configuration […]

Read more…

ASP.NET Membership Provider: Changing user password without knowing the old one

If you want to change a membership user’s password with the MembershipUser.ChangePassword method you need to know the user’s old password. The following extension method defines a SetNewPassword method that enables you to reset the password without knowing the old one: public static class MembershipUserExtension {   /// <summary> /// Set a new password for […]

Read more…

ASP.NET MVC3: Controller extension methods to render a partial view to string

To handle AJAX form requests in my ASP.NET MVC3 controller I needed a way to render a partial view to a string to return a JSON result containing both the (server-side) validation result (as boolean) and a rendered partial view (as string). Unfortunately in ASP.NET MVC3 there seems no out-of-the-box support for rendering partial views […]

Read more…

ASP.NET MVC: How to add ELMAH (Error Logging Modules and Handlers for ASP.NET)

In this tutorial, you will find a step by step instruction how to add ELMAH (Error Logging Modules and Handlers for ASP.NET) to your existing ASP.NET MVC application. ELMAH is an easy-to-plug in library that logs and reports unhandled exceptions in ASP.NET application. It is described as follows: ELMAH (Error Logging Modules and Handlers) is […]

Read more…