InitializeSimpleMembership Attribute and SimpleMembership Exceptions

The InitializeSimpleMembership Attribute ensures that before any membership (login/register) related functionality is run, that the membership database has been created. If the database is not yet created, the code will automatically create one. If the simple membership initialization fails, the Web Application can continue to run requests that don’t require membership. Simple membership initialization failure…

31

Cascading DropDownList in ASP.Net MVC

I have written a simple sample showing how to implement cascading drop down lists in ASP.Net MVC.   In this sample the user is presented with a list of countries. Once a country is selected, a new drop down list is appears showing the states in the selected country. You can download the sample here. Although…

29

Securing your ASP.NET MVC 3 Application

Executive Overview You cannot use routing or web.config files to secure your MVC application. The only supported way to secure your MVC application is to apply the [Authorize] attribute to each controller and action method (except for the login/register methods). Making security decisions based on the current area is a Very Bad Thing and will…

25

Adding Bundling and Minification to Web Forms

My   B/M tutorial provides a good introduction to benefits of Bundling and Minification. You should read it to become familiar with the bundling and minification. This blog will focus on using B/M with Web Forms, my B/M tutorial focused on ASP.NET MVC. Create a new ASP.NET Web Forms application which targets the .Net 4.5 framework….

24

Securing your ASP.NET MVC 4 App and the new AllowAnonymous Attribute

2 March 2013 Update: Added security links 20 June 2012 Update: Cookieless Session and Authentication not supported in ASP.NET MVC.     Executive Overview You cannot use routing or web.config files to secure your MVC application. The only supported way to secure your MVC application is to apply the Authorize attribute to each controller and use…

20

Dynamic V Strongly Typed Views

There are three ways to pass information from a controller to a view in ASP.NET MVC 3: As a strongly typed model object. As a dynamic type (using @model dynamic) Using the ViewBag I’ve written a simple MVC 3  Top Blog application to compare and contrast dynamic and strongly typed views. The controller starts out…

18

Installing and using SQL Server Data Tools (SSDT) on Visual Studio 2010 and VWD

This blog post shows how to Install SQL Server Data Tools on Visual Studio 2010 and Visual Web Developer/2010. This MSDN article, also shows how to install Install SQL Server Data Tools. Launch WPI 4.0 ( Web Platform Installer ) Select All in the left pane and Products from the top. In the search box…

14

Test your ASP.NET MVC or WebForms Application on IIS 7 in 30 seconds

A frequent complaint in the ASP.NET forums is that an application works fine with Cassini (AKA, the built in Visual Studio Development Server), but fails when deployed to a real IIS server. The two most common reasons for this failure are: Cassini runs at the root level, so when resources (such as CSS and JavaScript…

13

Improving the FK field display: Showing two fields in Foreign Key columns

  The default scaffold of the CustomerAddress table in the AdventureWorksLT database poses a problem: Dynamic Data (DD) defaults to using the first string field in the referenced table. In this case, the first string field is the Title field (Mr,Ms, and so on).  The image below shows the problem with the FilterRepeater drop down…

10

Should my database calls be Asynchronous?

Update 28 November 2012: The combination of await, async, and the Task object makes it much easier for you to write asynchronous code in .NET 4.5.  Now that EF 6 is supporting Async Query and Save, you should take advantage of asynchronous programming. (As of this update, EF6 is not released so don’t use it…

10