Monday, February 22, 2010

Asp .Net 4 Empty Web Site and Clean Web.Config

Pro ASP.NET 4 CMS: Advanced Techniques for C# Developers Using the .NET 4 FrameworkOne thing I hate about previous Web.Config in previous versions of Asp .Net is its sheer size.

Asp .Net 4 has done a wonderful job in reducing the size of Web.Config by offloading the job to Machine.Config.

Inorder to take advantage of this you should start a Empty Web Site.














Tuesday, February 2, 2010

Asp .Net Membership - II aspnet_regsql to port Membership API database to Sql Server

In the blog Asp .Net Membership I - LoginStatus, Login and LoginView Controls
we saw how to work with Asp .Net Membership service.

By default the Membership Provider is creating a File System Database called AspNetDb.mdf under App_Data folder. This will suffice for small projects, where you can create rest of the tables in AspNetDb.mdf.
This by no means is an elegant solution, since usually the database will reside on Sql Server as Instance database and not in File System database. In effect there will be two database one for membership, role, profile, personalization, etc. and another for the application.

It is possible to merge the membeership database with out application database.

For that you can use aspnet_regql tool found in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 folder incase. Incase you are using Asp .net 4 the folder will be C:\WINDOWS\Microsoft.NET\Framework\v4.0.30128.

The wizard will prompt for the database to which you want to dump the membership, role, profile and personalization tables and associated database objects.

Related Blog

Asp .Net 2.0 Membership I - LoginStatus, Login and LoginView Controls