Explore the Premium Content

An Introduction to ASP.NET & Visual Studio .NET 2003

Although this version of Visual Studio .NET is not the latest version, there are still many developers such as myself who use this product every single day. Some of the radical changes brought about in the newest version of Visual Studio .NET 2005 made it nearly impossible to simply upgrade existing VS.NET 2002/2003 projects into the new version. We’re therefore left continuing development in the older version on complex projects that are simply too large to warrant upgrading.

In addition to developers who have been working with this product for a few years now there are also many new developers jumping into the Microsoft .NET world and learning Visual Studio .NET for the first time. As with any enterprise level development platform there is normally a large learning curve right off the bat.

The Visual Studio .NET environment itself really isn’t all that complicated, but can be a little overwhelming when first trying to navigate around. The majority of learning will be done on the framework itself and the different project types available.

In this tutorial we will look at some of the basic features of the Visual Studio .NET environment to help beginners get up and running and save some research time so you can feel more comfortable with the product. We’ll also explore one of the project types, ASP.NET, and look at some of the basic principles and theories behind this web technology.

Note: Although this tutorial is based on Visual Studio .NET 2003, version 2002 is nearly identical and should be able to be used with this tutorial as well

Read More

Databases for Beginners with ASP.NET 1.x

Databases for Beginners with ASP.NET 1.x

As a software developer, there will be very few times where you’ll find yourself building an application that does not involve the utilization of a database. The database is the backbone of your application, the root, the foundation, and the place of storage for all meaningful data contained in your software.

A database plus an application go hand in hand, when you speak of an application, it’s just implicitly taken for granted that the database is the core. There are of course many different options when it comes to which database to use for your application.

Years ago, flat files as they are known where commonly found. They were usually quite fast at processing but extremely inflexible, un-scalable, and completely proprietary. If you selected this style of database you were pretty much locked in for life as upgrading was simply not an option.

Oracle, SQL server, dBase, MS Access, MySQL are all commonly found today and are flexible enough to meet most applications needs. The database selected is normally chosen with the operating system in mind. Typically Java and Linux/Unix deployments will select Oracle, and .NET Windows deployments favour SQL server. Both are excellent high-end database servers which can facilitate some of the most complex, large scale applications in the world.

Cost is another factor of deployment. MySQL is a popular choice due to the fact that it’s free, but lacks the enterprise level sparkle found in Oracle and SQL server. MS Access is another cost effective choice and provides a very nice and easy to use feature set for developers.

Whichever database you deploy there are quite a few common components when it comes to developing your application. The first of course is connection, the second is database design fundamentals, and the third is database to application mapping.

The purpose of this tutorial is to explore some of these common concepts at a beginner level, and shed some insight into how to connect to and design your database driven applications.

Read More

Building a Logging Framework in ASP.NET 1.x – Part 2

Welcome to the second and final part of this tutorial regarding building a custom logging framework for ASP.NET applications. The purpose of this 2 part tutorial is to create an easy, customized and scalable way to log messages in your application, specifically exception messages and debugging messages.

During Building a Logging Framework in ASP.NET 1.x Part 1 we implemented the foundation structure of the logging framework. We created a singleton class which was able to initialize itself and read in several customization parameters required for logging. The customization aspect of the framework allows for real-time changes to logging parameters without recompiling your application.

In part 2 of this tutorial we will expand on our foundation and implement the code which will actually perform the logging functionality itself, writing the messages to the file system in the log file. We will also implement 3 different example logging shortcut methods which can log 3 different types of information.

Once the logging framework is complete we will implement some simple code-behind logic to test our logging methods and run through the 3 different scenarios for logging information using the debugger.

Note: Visual Studio .NET 2002/2003 running ASP.NET 1.x is required to implement this tutorial. Both C# and VB.NET code samples will be provided

Read More

Building a Logging Framework in ASP.NET 1.x – Part 1

One of the most enjoyable aspects of system architecture is designing new frameworks for new applications. This is the point in time of the design process where you can be the most creative and bring new design patterns and new knowledge to the table to continually build most robust, scalable and stable applications.

There are of course a few key staple infrastructures that need to be in place in nearly every application. Sometimes it’s fun to change it up and design these pieces in different ways to keep things fresh. There’s only so many ways you can create a login form for example.

One of the key foundation pieces to nearly any application is logging. Logging can be implemented in a myriad of different ways, depending on the scope of the application. Certain pieces are not always needed and sometimes using the built in .NET tracing is sufficient. Personally I always want full control over my logging needs so I always create my own logging framework from scratch.

The main purpose of most logging frameworks is to capture exceptions. Handling exceptions is paramount is application maintenance: If you cannot track down your bugs efficiently your application and end-user performance will suffer greatly. You therefore need a descent exception logging mechanism which will allow you to pinpoint errors in your application hastily.

Secondary logging purposes include tracing or debug statements. This can help expedite the development process by creating custom messages around complex algorithms which can help remove a lot of trial-and-error debugging and testing.

The purpose of this tutorial is to design a basic yet useful logging framework which is Object Oriented and expandable to larger scale needs should your application require it. Part 1 of this tutorial will focus on implement most of the foundation of the logging framework and the basics of how to use it. The second and final part of this tutorial will put the logging framework into a basic ASP.NET application structure and show you how to use the logging framework in a more real-world structure.

Note: Visual Studio .NET 2002/2003 running ASP.NET 1.x is required to implement this tutorial. Both C# and VB.NET code samples will be provided

Read More

Understanding Web.Config in ASP.NET 1.x

Understanding Web.Config in ASP.NET 1.x

With every ASP.NET application there is a root Web.Config file which resides in the website root directory and controls many complex aspects of your application. One of the troubles with this configuration file is that it covers many areas and has many options and parameters which are difficult to remember and sometimes confusing to understand the impact they will have on your application.

Part of the reason for lack of understanding is the fact that a default Web.config file is provided with a newly created ASP.NET application. Most of the time you can simply leave it alone and your application will run just fine. However it’s still important to understand what each entry in the default Web.config file means and even more important to know how to customize it to suit your needs.

The purpose of this tutorial is to serve as a quick reference for the options available in the Web.config file, and also to inspect some of the more commonly used configuration elements, thus creating a greater understanding of the flexibility available.

No tools or software are required for this tutorial, however it is recommended you have access to Visual Studio .NET 2002/2003 in order to test out the various settings that will be reviewed.

Read More
FREE

Free - Creating an RSS feed with ASP and Dreamweaver 8

Ever wanted to have the latest news automatically displayed on your site? In this tutorial Richard Mariner shows how to create an ASP RSS feed in Dreamweaver 8. RSS is a format for syndicating news and the content of news-like sites.

 

Read More

Custom ASP.NET Web Menu Control – Part 2

Welcome to the second and final part of this 2 part tutorial regarding creating a custom menu using ASP.NET’s Web Control Library projects.  During Custom ASP.NET Web Menu Control Part 1 we implemented a sample ASP.NET application and created a new Web Control Library project and created our own custom control which was responsible for displaying clickable menu items.

The menu items were fully customizable and could be coded for in the code-behind files of WebForms added to our sample project. We also built the ability to perform basic UI operations such as bolding the menu items and rendering the menu items either horizontally or vertically.

In this second part of the tutorial we fill focus on one of the more complex topics of custom web controls, which is linkage to the Visual Studio designer. To really make a custom control flow like a regular web control it needs to have the capability of being visually manipulated at design time by setting properties through the properties window.

We will expand upon our example built in Custom ASP.NET Web Menu Control Part 1 and add in the following features:

  1. Add a Designer class to render design time presentation
  2. Change the control name
  3. Demonstrate how to render custom HTML for the Visual Studio designer
  4. Add a font size property

Note: Visual Studio.NET running ASP.NET 1.x is required for this tutorial. Both VB.NET and C# code samples will be provided

Read More

Custom ASP.NET Web Menu Control – Part 1

There is often quite a bit of confusion when it comes to the topic of “custom controls” in the .NET 1.x world. This is mainly due to inconsistent naming conventions used on the different options available in Visual Studio .NET. Terminology such as user controls, web controls, custom controls, control libraries etc… being used to describe different development strategies makes it rather confusing to know exactly what type of control your application should use.

There are in fact 2 options for developing a “custom control” in ASP.NET. A custom control can be used to define either type, which simply means a control not provided by the .NET framework. The 2 options are: 1) Web User Control and 2) Web Control Library.

We’ll review each type in detail later on in the tutorial. This 2 part tutorial will focus on control type #2, a Web Control Library, which provides the greatest flexibility. This type of control is also the most confusing and difficult to implement.

To put this type of control into practical use we’ll build the control around a common topic of interest, which are navigation menus. The purpose of the control is 2-fold, create a reusable control that we can drag and drop onto any ASPX Web Form, and also to provide a completely customized programming experience and tailor the control to our specific needs of the application.

Part 1 of this tutorial will explore the differences between custom controls in more detail and create the framework for a Web Control Library in a sample ASP.NET application. We’ll explore the fundamentals of this type of custom control and demonstrate how to get the basic functionality of the menu working. In Part 2 we will advance upon this framework and build more aesthetics into the interface of the component as well as explore creating Design time properties to reduce code-behind logic.

Note: Visual Studio .NET running ASP.NET 1.x is required for this tutorial. Both VB.NET and C# code samples will be provided

Read More

How to Cache Search Criteria in ASP.NET

How to Cache Search Criteria in ASP.NET

When developing nearly any application, one of the least considered aspects is unfortunately usability. Let’s be honest here, us developers are great at writing complex algorithms, designing database entity relationships and object oriented class structures, but when it comes down to the everyday user we often lose touch with what’s important.

Not that it’s entirely our fault, oftentimes a usability expert is just something not all developers have at their disposal. Having a key individual who has a strong grasp of the end user requirements is often your best source for usability.

Creating an easy to use application is a challenging task. Usability is a sum of all its parts, meaning an application must flow together and be logical on each page, as well as together as a whole. In this tutorial we’ll take one small piece of usability and implement it in such a way that it can even affect other pages.

The premise is quite simple, a lot of search pages, list pages or reports pages require several parameters as criteria, our goal is to cache these criteria so that the user can leave the page, return to the search page and have the criteria from the previous search pre-filled, and possibly re-execute the search automatically.

Entering information into forms is probably the most time consuming aspect of the end-users job, and probably the least considered from a developer, so this criteria caching pattern can really save your end users a lot of time.

We’ll implement a simple sample application in ASP.NET 1.1 with a search form, connected to a live database for demonstration purposes. The user can search, view the results, then navigate away from the page, and later return with the previous search fields pre-filled, all in a pattern which will keep the session clean and easy to read.

Visual Studio .NET 2002/2003 running ASP.NET 1.1 is required for this tutorial. Connection to an SQL or Access database is desirable however not required for understanding the cache pattern. The sample pubs SQL database will be used for demonstration in this tutorial. Both VB.NET and C# code samples will be provided

Read More

How to Run MS Access Queries from ASP.NET – Part 2

Welcome to part 2 of this tutorial on how to execute queries requiring parameters from Microsoft Access. As previously mentioned in part 1, Microsoft Access is probably one of the most popular small scale application databases in use today, and is therefore the topic of discussion amongst many developers.

One of the surprising aspects of Visual Studio.NET 02/03 is that it did not come with an easy way to integrate Microsoft Access queries. With full support of SQL stored procedures the data wizards in Visual Studio.NET made it a breeze to program create/update/view/delete functionality automatically and will even create the required stored procedures for you.

Hence the purpose of this tutorial is 2-fold: 1 is to demonstrate how to connect to a MS Access database and execute queries which require parameters, and 2 is to implement this functionality in a scalable 3-tier design using class separation.

In part 1 of this tutorial we covered the database creation, setting up the ASP.NET project, connecting to the Access database, how to create the 3 tier application, and how to execute an MS Access query to return a set of data. This query did not require a parameter however.

During part 2 of this tutorial we will expand on our demonstration application by creating a create and update query, both of which require parameters. We will create an interface in order to visually see the create and update process on a WebForm.

Visual Studio .NET 02/03 running ASP.NET version 1.1 is required for this tutorial. A version of MS Access is also required. Both VB.NET and C# code samples will be provided

Read More

How to Run MS Access Queries from ASP.NET – Part 1

With ASP.NET version 1.1 it’s a little surprising Microsoft didn’t make working with Access databases a little easier. Visual Studio .NET 2003 and prior were mainly geared towards SQL server integration. Though you can connect to Access databases without issue, you cannot have the Data Access wizards run or create queries within Access for you like it can with stored procedures for SQL server.

The purpose of this tutorial is to achieve exactly that, to be able to connect to an Access database and execute its queries, without the use of the GUI Data wizards. We’ll take this framework and build a simple mini-application with several features over the course of this 2 part series.

Visual Studio .NET running ASP.NET version 1.1 is required for this tutorial. Both VB.NET and C# code samples will be provided. You will also need a version of MS Access

Read More

Entity Descriptor Pattern in .NET

When developing applications of a more complex nature your role as an architect or senior developer is to create reusable patterns that your development team can implement and follow. Even if the application is not an enterprise level piece of software, having clean patterns in place make your development and code implementation much smoother and easier to follow.

The reason for these patterns is very important: Each developer will of course have their own way of implementing certain things; it’s the nature of a human being to do things the best way they see fit. While each developer may have a perfectly acceptable method of implementation the fact remains that they will all be individually different, and that can create confusion in the code.

As the architect your job is to ensure the development team sticks within certain boundaries of coding and the way to achieve that is through patterns. The key to adoption within the team is to brainstorm and discuss certain implementation strategies. Then a decision is made based on the collective ideas from the team and a pattern is created that all developers will then follow.

The pattern itself shouldn’t be considered as the ultimate way to implement certain chunks of code but rather be perceived as a best effort and most importantly a uniform way of defining code segments.

That being said the purpose of this tutorial is to take a common pattern found in almost any application and define it in a simple and reusable fashion using Object Oriented (OO) techniques. The pattern we will look at relates directly to database modelling and representing single entities of information once they have been extracted from a data store.

The goal is to map an object to a database record and use OO techniques to make a developers life easier when working with these objects. For this tutorial we will use ASP.NET to implement an example application although the code and pattern can be applied to any .NET project type.

Note: ASP.NET running version 1.1 is required for this tutorial. Both VB.NET and C# code samples will be provided

Read More
Newer articles Older articles