Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Architecture
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
Bing
BizTalk
Book Excerpts
Build and Deploy
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Design Patterns
Development Process
Display Technologies
Distributed Computing
DotNetNuke
DSL
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
Internet Explorer 8.0
Interviews
iPhone
Iron Ruby
Java
Java Script
jQuery
LINQ
Linux
Mac OS X
MDX
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
Network
NHibernate
Object Oriented Development
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
Podcasts
Post Mortem
PowerPoint
Print/Output
Product News
Product Reviews
Project Management
Python
Q&A
Rails
Rake
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Search
Security
Services
SharePoint
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server CE/AnyWhere/Mobile/Compact
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
Tips
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WF
Whitepapers
Windows 7
Windows Azure
Windows Live
Windows Server
Windows Vista
WinForms
Workflow
WPF
XAML
XML
XNA
XSLT



CODE Training


 


iPhone iPad Developers Conference

Reader rating:
Click here to read 5 comments about this article.
Article source: CoDe (2007 Sep/Oct)


Article Pages:  1  2 3 4 5 6 - Next >


Creating Web Sites with ASP.NET 2.0

“Web application development has come a long way in a fairly short period of time.” A quote like that surely won’t send anyone into shock anytime soon because it’s accepted as fact. From basic, static HTML pages to totally data-driven and data-centric Web applications, the demands on a Web developer are much more complex and demanding than they were just a few years ago. The advent of social networking sites like MySpace, which is written in ASP.NET 2.0, interactive mapping sites, and sites streaming full motion video has required the Web developer to adapt and change with the times. One of the best tools to use to build these types of Web applications is Microsoft’s ASP.NET 2.0. In this article I am going to delve into some of the more interesting features of ASP.NET 2.0 and show you how you can begin using ASP.NET 2.0 on your next Web project.

ASP.NET 2.0 offers features that every ASP.NET developer will find useful, including:

  • Multiple project types
  • A wide variety of Web controls
  • Project folders to help organize files
  • Enhanced code-behind model
  • Master pages and themes
  • Site navigation features
  • Enhanced data access features
  • Membership and personalization
  • Portal architecture including Web parts
  • Site administration tools

In this article I’ll take a detailed look at a number of these features including Visual Studio 2005 enhancements, the code-behind model, the Web controls, the master pages feature, the themes and skins feature, and the site navigation features.

Creating a Web Site

With the release of Visual Studio 2005 SP1, Microsoft offers Web site developers a choice between two different project types: the Web Site and the Web Application. The Web Site project really is not a project at all since Visual Studio 2005 solution and project files are not created. In the Web Site model all pages and code are stored in a directory, much like the traditional ASP model. When it comes to deployment, the easiest approach is to copy all of your files to your Web server and everything compiles on demand. You could also use the aspnet_compiler.exe utility to precompile your site into a binary file and deploy to your Web site.

The Web Application project is an implementation of the type of Web project available in Visual Studio 2003 and consists of a solution (.sln) and project files (.vbproj). It is the result of Microsoft listening to the ASP.NET 2.0 developer community and responding to the needs of the community. It provides the benefit of generating a single assembly in the local /bin folder ready for deployment. This model also makes it easier to incrementally deploy changes made to your site. If you are converting a Web application from Visual Studio 2003, this is the project model you are going to want to adopt. I use this model with most of the Web applications I develop.

To create a Web site with the Web Application project model, launch Visual Studio 2005 and from the File menu option choose New Project… and the New Project dialog box will appear (Figure 1). Choose ASP.NET Web Application, the name of the project, the location, and the name of the solution if you select to have one created or specify if you want the new project added to the current solution. Click OK and Visual Studio will create the solution (.sln), the project (.vbproj since I selected Visual Basic), a default.aspx page, and a Web.config file.

Click for a larger version of this image.

Figure 1: The New Project dialog box specifies the name, location, and language for your Web Application.

To create a Web site with the Web Site project model, launch Visual Studio 2005 and from the File menu option choose New Web Site and the New Web Site dialog box will appear (Figure 2). Choose ASP.NET Web Site, the location of the Web site, the language used, and lastly, the name of the Web site.

Click for a larger version of this image.

Figure 2: The New Web Site dialog box specifies the name, location, and language for your Web site.

I don’t need to explain the name of the Web site and the language you want to use but I’ll discuss other options. The location dropdown offers three options: File System, HTTP, and FTP. Creating a File System Web site is the simplest approach because your Web site can reside in any directory on your hard drive or shared network drive. The advantage of a File System Web site is that you can run it using Visual Studio 2005’s built in development Web server. You don’t need IIS though you can use IIS to run a File System Web site by creating a virtual directory for the directory you are storing the Web site in.

The second option, choosing HTTP as the location, will direct Visual Studio 2005 to automatically create a Web site in an IIS virtual directory. This saves you the step of creating the virtual directory in IIS but obviously you need to have access to an IIS server.

Choosing FTP as the location allows you to actually store and even code your application on a remote Web server somewhere. If you’ve selected this option, click the Browse button to display the Choose Location dialog box and then select a directory, an IIS virtual directory, and then enter the FTP parameters required to log on to an FTP location (Figure 3).

Click for a larger version of this image.

Figure 3: Site location can be FTP folder on a distant server.

Once you have decided on the name, location, and language for your new Web site, click OK to create the site. Visual Studio will create a Default.aspx page, Web.config file, and an App_Data folder. One primary difference between the Web Site project model and the Web Application project model is that in the Web Site model settings are stored in a Web.config file as opposed to project file.

&

By: Jim Duffy

Jim Duffy is founder and president of TakeNote Technologies, an award-winning training, consulting, and software development company specializing in .NET software developer training and helping clients create business solutions with Microsoft enterprise technologies like Virtual Earth. Jim's expertise is with Visual Studio, Visual Basic, ASP.NET, SQL Server and Visual FoxPro-to-.NET conversions. He has a BS degree in Computer and Information Systems and over 25 years of programming and training experience. He is an energetic trainer, skilled developer, and has been published in leading developer-oriented publications.

Jim is a Microsoft Regional Director, a Microsoft MVP award recipient since 2003, an INETA speaker, and is an entertaining and popular speaker at regional user groups and international developer conferences. He is also a co-host of Computers 2K9, a call-in radio show on WRBZ (AM 850), 850 The Buzz, in Raleigh, NC.

You can find additional information about Jim, TakeNote Technologies, links to his blog, as well as a public training class schedule, on-site training information, consulting information, and software development services at www.takenote.com.

jduffy@takenote.com

Fast Facts

The ASP.NET 2.0 feature list is impressive. It ranges from high-level issues such as the project structure architecture down all the way down to Web control features such as the Focus method which causes the cursor to appear in a control.



Article Pages:  1  2 3 4 5 6 - Next Page: 'Controls, Partial Classes, and Smart Tags' >>

Page 1: Creating Web Sites with ASP.NET 2.0
Page 2: Controls, Partial Classes, and Smart Tags
Page 3: ASP.NET 2.0 Web Controls
Page 4: Master Pages
Page 5: Themes and Skins
Page 6: SiteMapPath Control

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
2.2 out of 5

156 people have rated this article.

      Hacker Halted

 

DevLink