Explore the Premium Content

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

Web 2.0 for developers

Web 2.0 is one of those terms that’s used without many people understanding what it actually means. Web 2.0 describes an alternative approach to the Web that is different from traditional sites and applications. You can think of it as a second generation of Web sites and applications. O’Reilly first used the term in 2004 after a conference brainstorming session held with MediaLive International.

A common phrase in the Web 2.0 world is “the Web as a platform”. Web 2.0 emphasises the Web as a platform for sharing data and for social interaction. Approaches such as wikis, tagging and blogging are very much part of the Web 2.0 world.

Developers have a particular interest in creating Web 2.0 applications and sites and in the new tools and approaches available. You may have heard of the term Rich Internet Applications or Ajax. Developers can use these approaches to create Web 2.0 applications that rely heavily on technologies such as XML, XHTML, CSS, RSS, Web services and Flash.

In this article, I’ll give you an overview and outline of what Web 2.0 means both in general and for Web developers. I’ll cover the technologies that are usually considered part of the Web 2.0 movement and look at some examples of where it is used in practice. By the end of the article, you should have a better understanding of what Web 2.0 means although we won’t get our hands dirty with any code.

Read More
FREE

Free - Applied MS Reporting Services 101 using Smart Client

Introduction


I still remember it was a neatly done report that got me my first pay raise.  Ever since, I am very passionate about report writing (every one likes a pay raise right?).  In this article, I will guide you through step by step on how to create a simple report using MS Reporting Services 2005; and host it with a Smart Client application.

So, are you ready to get your pay raise? Why not! Who knows, your neatly done report can just do that.

Prior to this article, I wrote three others, which were addressing different issues related to the reporting services.  However, all of them were targeted towards the intermediate-advance level audience.  From all the feedback I received, one was common, quite a few of you asked for an article which will be specially geared towards the novice-beginner level.

I assume the reader has a basic understanding of Visual Studio 2005 IDE and is comfortable with writing code using C#.  You don’t have to know MS Reporting Services to understand this article; although, any pervious experience with writing a report would help.

Although, I am calling this article 101, my intention is to adopt the applied approach rather then discussing each and every topic associated with reporting services.  I am touching the most common aspects of report design and I use the  most common controls.  I would strongly encourage you to go through the MSDN documentation for more detailed information.

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

Building Rich Text Editor. Part VII

Introduction

This is the final article of the series on building online Rich Text Editor.

While creating the application in the course of the series (Part I to Part VI) we have covered various development techniques utilizing both client-side and server-side technologies.
At this point our Editor resembles a lightweight desktop text editor not only by look and feel but also the impressive array of tools for editing, formatting and file manipulations.

In Part VI we have built the Server File Browser – a small widget for browsing dedicated web folder. This tool is designed to work in a manner similar to Windows Explorer, so we can load and save HTML-based documents from/to the server. Now we can select or enter the name for the file we want to open or save, but the actual functionality for saving and loading has not yet been built. We will cover this gap in the current article.
We will also tie up some loose ends so our application can be complete.

Building Open and Save functionality

We are going to start exactly where we left off – in the Server File Browser module.

At this stage when we run the application in the browser we can open the Server File Browser and select or enter the name for the file to be opened or saved.

Once a file has been selected the dialog will close and call the corresponding function (either openFile() or saveFile()) located in the main window. This is the function that performs the task in open_save.php:

function passValue(v,e){

      if(v!=""){

            if(window.opener!=null){

                  with(window.opener){

            <?php if(isset($_GET['a']) && isset($_GET['a'])=="s"){?>

                        saveFile(v,e);

            <?php } else{ ?>

                        openFile(v);

            <?php } ?>

                  }

            }

            window.close();

      }

}


Although at this point both functions are in place on the Editor page, they contain no code –something we need to take care of.

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

Creating a line chart component – part 2

In part 1 of this tutorial, we started to create the line chart component. We created a movie clip containing the assets that we need as well as the class file. We added some private variables and created a constructor function as well as an init function to set up the component.

In part 2, we’ll finish off the line chart by adding the public parameters. We’ll do this using setter methods and the createChildren function. You’ll see how to use the drawing API to create the axes and the line.

This tutorial uses Flash 8 and ActionScript 2 with the version 2 component architecture, so you’ll need Flash 8 to view my completed files. You can still create the component using Flash MX 2004.

The tutorial assumes that you understand the general process of creating a component. If not, you might want to go back and look at the first article in this series. I have also assumed that you know how to write AS2.0 class files.

You don’t have to have completed part 1 of the tutorial first before starting on this article, but it will help. If you haven’t done so, the resource files included with the tutorial contain the files as we left them after the first tutorial. In that case, you’ll need to unzip the resources and rename the files LineChart.as and LineChart.fla.

You can download the starter files from part 1 as well as the completed component files from the blue Properties box that contains the article PDF. There's a heading titled Code Download and you can click the Details link next to it to get the zip file.

Note: If you have difficulties downloading the source files or PDF, you might have a problem with your cookies. Delete the cookies from your machine and try again. In Internet Explorer, you can do this by choosing Tools > Internet Options… and clicking the Delete Cookies… button on the General tab.

Read More

Developing Flash/Database interaction using Dreamweaver. Pt I: User Authentication (updated)

Have you ever wanted to build a database-driven Flash application but felt confused by the "database-driven" part?

Are you easily scared by the terms "Databinding", "Flash Remoting", "Web Services" and "Delta Packets"?

If your answer is "Yes" to both questions then you've come to the right place.

In this short series of articles we'll show you how easy it is to develop Flash / Database interactivity using the visual tools of our favorite web editor. Using Dreamweaver, we'll make Flash "talk" to a database in order to create, view, update and delete records.  You'll also learn a few useful tricks to help you manage your Flash application projects in a more secure and efficient way.

In this first article on the subject we're going to look at building a generic authentication mechanism, which is simple and efficient enough to be quickly integrated into almost any type of small web application.

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
FREE

Free - Create a local SQL Server connection and read data to a page using Dynamic Tables

Are you ready to start building dynamic sites that get their data from tables in the database? Then check out another great tutorial from Richard Mariner that shows you how to get started.

 

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

Photoshop: Embedded Colour

From RGB to CMYK: Embedded Profiles in Photoshop

Embedded profiles are, by far, the safest way to save your colour choices when you transfer a document from your monitor to several output destinations. Whether you work in RGB or CMYK, the embedded profile can save your images from faulty colour management. But, this process only works when all concerned understand what the profile stands for and why it’s there in the first place. In this article, Linda takes you through the basics on why and how to embed a profile into your document or image in Photoshop. In the process, you’ll also learn how to “soft proof” you document when you alter the RGB colour space to CMYK…

Read More
Newer articles Older articles