Sign In

Navigation

On This Page

Archive

<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Categories

Blogroll

Contact

Send mail to the author(s) Email Me
MCPD
MCTS

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way


Copyright ©  2010
 Creative Commons License
This work by Jeff Klawiter is, unless explicitly stated in the article,  available under the Creative Commons Attribution 3.0 United States License.

Pick a theme:
# Thursday, November 05, 2009
by Jeff Klawiter - Thursday, November 05, 2009 9:05:51 PM (Central Standard Time, UTC-06:00)

I went to create my first new website with Visual Studio 2010 the other day and was quite surprised with what I found.

image

In all versions prior to 2010 a new website would just get you a Default.aspx and the corresponding language codebehind file. This changes quite a bit with 2010. You actually will now be presented with a full website ready to go. Complete with a Master page, account login and more.

image

Digging in Further yields some nice little nuggets. First off the Site.Master isn’t just a blank master page with a ContentPlaceHolder. It actually contains a relatively decent CSS layout with LoginView and Menu controls.

image

Along with the Site.Master the site comes with Default.aspx, About.aspx and an entire directory dedicated to authentication. The Account directory is set up to handle all the most common authentication scenarios: Login, Register and Password Recovery. Furthermore these pages include actual code in the codebehind.

One thing however that it is missing is the database to authenticate with. If you are planning to use your own membership provider or an external database you just need to set it up in the web.config. If you’d like to just use an sqlexpress database you can use the ASP.NET Website Administration Tool to do this for you. This tool was added in .NET 2.0 and the current version doesn’t seem to have changed much. To generate the ASPNETDB.MDF SQLExpress database. Just click on the Tool and World icon in the Solution Explorer.

image
Another way to access this tool is via the ASP.NET Configuration command under the Website menu.

image

The best way to have it set up the database is to click on the “Use the security Setup Wizard..” link. This will take you through setting up the database, roles, users and locked down directories.

Beyond the account code the site comes with jQuery 1.3.2, it’s minified version and the Visual Studio Intellisense file. Unfortunately the jQuery files are not referenced by default in the master page or any of the other pages. I would have loved to have either an example usage or at least a reference to the file. To add jQuery it’s just a simple addition to the master file. After that just force VS to update its javascript intellisense using Ctrl+Shift+j

image

Rarely do I start out a website this way these days, most my sites I start are powered by one CMS or another. Besides those times I’ve been trying to use ASP.NET MVC more these days. I still use the default webforms site when I need to get something up and running quick with some basic data controls. I recently did a website for planning a family reunion. I could have saved myself a half an hour or so getting just the base of the site set up.

Tuesday, November 17, 2009 3:19:09 AM (Central Standard Time, UTC-06:00)
It´s always cofusing when i switch to a new version of any software. nice job on the blog. I will be back for more.
All comments require the approval of the site owner before being displayed.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview