Explore the Premium Content

Import/Export Outlook Contacts in ASP.NET

Import/Export Outlook Contacts in ASP.NET

Integration in applications is quite often a requirement when building larger scale applications. With customers and clients using such a variety of productivity applications there is quite often a need to make use of these other applications within your own, which can cause a headache due to the complexity involved.

One of the more popular productivity suites in use is Microsoft Office. Customers more often than not will want a way to merge their productivity between applications such as Outlook, Word and Excel within your application, which is definitely no easy task.

We’ll be using the built in OleDb data classes for database connectivity and some fairly complex DataSet and DataTable manipulations to accomplish our importing from the CSV file.

Note: Microsoft Outlook, Access and Visual Studio .NET are required to fully complete the entire tutorial. However the code provided will also have value alone if you’re interested in CSV importing.

Both VB.NET and C# code samples will be provided

Read More

Dreamweaver ASP.NET User Management Systems: Creating Custom Encrypted Authentication Tickets

In the other tutorials in this series we explored the ASP.NET security model and utilizing it to build rich featured User Management Systems using Dreamweaver. We learned how to use the web.config file to configure security on ASP.NET web application. We learned how to authenticate a user using Forms Authentication method. We learned how to create cookie to hold a user’s role and how to create a custom Generic Identity object to maintain the user’s role authorization from one request to another. Finally we learned how use the role information and Generic Identity object to programmatically control our user experience. In this final tutorial in the series, we will build upon prior discussions as we take over the Forms Authentication Ticket creation process to create our own custom authentication ticket and encrypt it using the ASP.NET FormsAuthentication class. That said, this tutorial stands on it’s own in the presentation of the topics covered.

Before you get too involved, let’s see if you’re ready. This tutorial makes assumptions about your skill level--that is, this tutorial is intended for intermediate users. If you’ve never configured a new site in Dreamweaver, never configured a database connection string, or never used the Dreamweaver database connectivity tools, this tutorial is probably not for you as you’ll need to be familiar with these concepts and techniques. If you have done these things but have very little or no experience hand coding, writing SQL statements, using the Dreamweaver advanced Dataset Dialog, don’t worry we’re doing this together and I’ll do my part to bring you along.  

Read More

Using the ASP.NET Calendar Control

When building web applications, at some point during your requirements documentation you’ll probably come across the need for users to enter dates onto a form. Working with dates may seem like a simple task but it can quite easily become very complicated.

The reason date entry becomes complex is because of the validation that needs to be performed. In older languages this validation was provided by the developer. They had to consider all kinds of conditional checks, such as the number of days in the selected month, whether the selected February was in a leap year, as well as all the rules regarding leap years.

Fortunately, ASP.NET has made this style of date programming a thing of the past. The .NET framework has a built-in calendar component which provides all the basic functionality for most development scenarios and it comes pre-programmed with all of the aforementioned validation already in place.

By using this component the developer can focus on other aspects such as presentation and usability functionality instead of worrying about whether February 2028 has 28 or 29 days.

In this tutorial we’ll look at some of the basic functionality provided by the ASP.NET Calendar component and two basic examples of common usage of this component in web applications. We’ll also look at some of the basic formatting methods provided by the Date class.

Note: This tutorial requires Visual Studio .NET and both VB.NET and C# code samples will be provided

Read More

Building a Data-Driven Navigation Menu

Navigation menus are the forefront of just about any website, whether the site is a dynamic database driven application or simply a personal homepage. They lead and direct your user around the pages of your site and provide the basis for your usability experience. A site that is difficult to navigate is a site that will not be popular with your users.

When working with ASP.NET you have a lot of extra flexibility when working with a navigation menu. In most development languages, your menu needs to be copied/pasted onto all of your pages, or at the very least you had to use include statements to place the menu at the top of every page. This process is very redundant and cumbersome.

ASP.NET offers the ability to create user controls, which are custom chunks of HTML and code-behind server logic which can be dragged/dropped onto any .aspx Web form in your application, making the development of a component such as a navigation menu quite easy, and very reusable.

In addition to a custom user control, you can add in your own server logic to extend the menu control even further and allow it to be data-driven from a database of your choice. This way your menu is rendered on-the-fly dynamically from records read from a database table which can be modified in real time.

In this tutorial we will build a sample application to demonstrate this powerful technique. We will build a custom user control to house our navigation menu which can be dropped onto any page in our application. And we will implement functionality to make our user control database driven from an Access .mdb database, rendering menu items and submenu items dynamically.

Note: This tutorial requires Visual Studio .NET and if you wish to change/customize the database provided you will also need Microsoft Access.

Read More

ASP.NET Image Gallery, Uploader & Thumbnailer Part 2

Welcome to part 2 of our demonstration image gallery creator, image uploader and thumbnailer application built in ASP.NET. As we’ve seen so far, we’ve been able to provide thumbnailing and image sharpening methods using built in objects that are part of the .NET framework.

To summarize, in part 1 we created an ASP.NET application called ImgThumbail and setup a folder structure for uploading images to the web server. We then added an ImageUtil class which can receive HttpPostedFile objects and create thumbnails for the images returning the binary content which can be written to the file system. We also implemented a method which uses a math algorithm to sharpen the image.

In part 2, we’ll continue building upon our application by developing the user interface and putting our ImageUtil class into action. We’ll build a web page which allows a user to upload an image to the web server, and then display those images dynamically in an HTML table constructed on-the-fly through code.

Once again Visual Studio.NET is required for this part of the tutorial, and both VB.NET and C# code samples will be provided.

Read More

ASP.NET Image Gallery, Uploader & Thumbnailer Part 1

Working with images is a requirement of many applications, from business software to simple personal web pages. There are hundreds of different implementations of this feature, some good, others not so good. When using images in ASP.NET applications you have the added benefit of making things a little easier on yourself by using a more object oriented approach so that you can create components that you can reuse in other applications.

Depending on the requirements of your images module it may be necessary to look towards third party components. There is literally hundreds of ASP.NET third party controls which deal with imaging, image uploading and image manipulation. Before you implement a costly third party component it’s important to understand what you can and cannot do with the existing .NET framework.

The purpose of this article is to show 3 basic imaging techniques you can implement in your applications which all make use of the existing .NET framework classes. These three techniques are: uploading, thumbnailing, and dynamic display (gallery).

For this article we’ll build a simple demonstration ASP.NET application where you can upload an image into a specific folder on the web server, have that image automatically thumbnailed on the fly, and then have the image thumbnails rendered into an HTML dynamically. These are the basic building blocks of most applications utilizing images.

Note: Visual Studio.NET is required for this tutorial. Both VB.NET and C# code examples will be provided

Read More

DataBinding for Beginners in ASP.NET

DataBinding for Beginners in ASP.NET

When building any application, whether it’s ASP.NET web apps or WinForms desktop apps you will eventually come across the need to DataBind. DataBinding is the basic process of presenting dynamic data sources within a user interface component.

DataBinding isn’t limited to just interface components, but it is probably the most common occurrence you’ll encounter. Without DataBinding your web pages would only be able to display static data, or dynamic data populated programmatically.

DataBinding can take on numerous formats, from very simple to complex. The .NET framework also provides you with many possible DataBinding properties throughout the web control library to give you a lot of control and flexibility. Take for example a Label control, you can bind its foreground and background color properties. Although not a common requirement it shows binding can be more advanced than simple text values.

In this tutorial we’ll look at several basic examples of DataBinding on different controls available in ASP.NET. We’ll explore basic page property binding for a Label control, custom class property binding for a TextBox control, collection class binding for a DropDown control, and DataTable binding for a DataGrid control.

Note: Visual Studio .NET is required for this tutorial and both VB.NET and C# code examples will be provided

Read More

Dreamweaver ASP.NET User Management System: Emailing Lost Passwords

In this tutorial, the third in my series on Forms based User Authentication and Authorization with Dreamweaver and ASP.NET, we’ll learn how to build an “Email Lost Password” page to complete our User Management System. If you have not yet read the first of this series, “Multi-Level Forms Authentication with Dreamweaver and ASP.NET: Roles Logins”, or the second Dreamweaver ASP.NET User Management System: Creating and Managing User Groups, I recommend you do so as this tutorial will build upon in earlier in depth discussions of the concepts involved. That said, this tutorial stands on it’s own in the presentation of the topics covered. If you already know how to configure your web site for forms authentication security and roles using the web.config, how to log those users in and associate the user’s identity and role, and how to control the user’s browsing experience programmatically based upon user identity, how to create new users and mange their group membership, then the first two tutorials are probably not for you. 

Before we get started, let’s see if you’re ready. This tutorial makes some assumptions about your skill level--that is, this tutorial is intended for intermediate users. If you’ve never configured a new site in Dreamweaver, never configured a database connection string, or never used the Dreamweaver database connectivity tools, this tutorial is probably not for you as you’ll need to be familiar with these concepts and techniques. If you have done these things but have very little or no experience hand coding, writing SQL statements, using the Dreamweaver advanced Dataset Dialog, don’t worry we’re doing this together and I’ll to do my part to bring you along.

Read More

ASP.NET for Beginners

The purpose of this tutorial therefore is to give new developers or even veteran developers looking for a refresher, a very basic look at the core features and functionality of ASP.NET 1.1. We’ll review some of the theory and key concepts to ASP.NET and look at 2 very basic code examples.

We’ll try to unravel some of the mysteries behind what is going on when you use the types of features in ASP.NET so you have a more clear understanding of how to take the knowledge and apply it in your own applications.


Read More

Dialogue Boxes in ASP.NET

Dialogue boxes are a fundamental part of any application, whether it be a desktop or web application.  They provide a basic level of interaction between the application and the end user, allowing the user to control basic application flow through various messages.

Web applications in general often make it difficult to implement even basic functionality that is easily provided in the desktop world due to the single request/response methodology in a thin client/server model. To make matters worse, the ASP.NET postback pattern makes it even more difficult to customize page flow.

Although the postback pattern in ASP.NET has made a world of improvements in everyday basic development, it has also created several new shortcomings and limitations that require some trickery and creativity to make certain features work.

Adding even further to the limitations of the postback pattern is the use of JavaScript by the .NET framework to control most user interface events. Clicking a button for example executes some JavaScript which reloads the page, sending a postback event to the server.

The reason this complicates matters so much is because most developers turn to JavaScript when implementing basic client side features, such as confirmations, alerts and popups. Tying into the existing JavaScript used by the .NET framework isn’t always the easiest and requires a thorough understanding of the JavaScript utilized by .NET on web form controls.

In this tutorial we will look at 3 different methods of providing basic user input and interaction using JavaScript and ASP.NET controls. We will look at how we can append our own functionality to the built in .NET JavaScript functionality provided by ASP.NET user controls.

The 3 examples we will look at are as follows:

1)       Alert information display

2)       Confirmation conditional processing

3)       Modal Dialogue Popup window with conditional processing

Although this tutorial is built using ASP.NET with Visual Studio .NET, the code required is extremely simplistic and the functionality is geared more towards JavaScript client side code.

Note: Both VB.NET and C# examples are provided in this tutorial

Read More

Dreamweaver ASP.NET User Management System: Creating and Managing User Groups

Managing users and user groups users is necessary on a number of websites, for instance the one you’re using now has different user groups with different duties and levels or authority. If you’ve spent much time developing with Dreamweaver and Classic ASP, you used Dreamweaver’s built in support for user management. If you wanted to create a new user, it was only a point and a click away in the Server Behaviours drop down. Imagine my surprise when, while building my first ASP.NET application, I found no such behaviour I could simply apply. No, I had to figure it out myself and it was far too late to add any extra money to the project budget for overtime! As it turned out, with careful thought and a few Google searches, I was able to craft a page that added new users without duplicates and without killing my weekend.

In this tutorial, the second in my series on Forms based User Authentication and Authorization with Dreamweaver and ASP.NET, we’ll learn how to build a “Create New User” page and a User Management System for assigning Roles to new users by joining them to user groups. If you have not yet read the first of this series, “Multi-Level Forms Authentication with Dreamweaver and ASP.NET: Roles Logins”, I recommend you do so as this tutorial will build upon in depth discussions of the concepts involved found in the first tutorial.

Read More

Creating a Stateful Web Service

Creating a Stateful Web Service

One of the problems in web development is the server-client model, or specifically the thin-client model. Where thin client refers to the web browser being used to access your application. This style of client-server model is a stateless model, meaning that no information (state) can be retained across multiple requests to the server.

This is essentially how the web functions, and it creates several inconveniences in development due to the workarounds that can be implemented. Most developers are familiar with the session object, which is a uniform concept in web applications that can be found in most development languages. Session variables allow your application to become stateful because you can store information for each individual user and persist that information across multiple requests.

Note: This tutorial requires Visual Studio.NET. Both VB.NET and C# code will be provided for both the Web service application as well as the consumer ASP.NET application

Read More
Newer articles Older articles