Explore the Premium Content

Using Skins and Themes in ASP.NET 2.0

The advent of the .NET framework version 2.0 has brought along several radical changes in all aspects of development from desktop to web applications. Making the switch from ASP.NET 1.x to 2.0 is quite the undertaking as many of the core methodologies used in 1.x are no longer available in 2.0.

Along with change comes improvement, and in many ways ASP.NET 2.0 has changed for the better. ASP.NET 2.0 has changed the way web applications are developed much the same as ASP.NET 1.0 changed classic ASP, they are similar but in many ways they are worlds apart.

In this tutorial we will look at one of the new features available in ASP.NET 2.0 called “Themes”. Themes or skins allow a developer or GUI designer to create multiple interface appearances for the same application through the use of CSS stylesheets and .skin files. Skin files are a new type of file available in ASP.NET 2.0.

Read More

Implementing Custom Role Security in ASP.NET 1.x – Part 2

Welcome to Implementing Custom Role Security in ASP.NET 1.x Part 2. In this second and final part of this tutorial we will build upon the code and framework developed in Implementing Custom Role Security in ASP.NET 1.x Part 1 and finish off the sample applications requirements.

During Implementing Custom Role Security in ASP.NET 1.x Part 1 we began implementation of a sample application that was designed to create a permissions “aware” custom button control. The purpose of the application is to allow a user to log into an application and have that user’s Role dynamically bound to their user security principal, thus giving a custom button control access to that role and determining if the user is authorized to access its functions.

By creating a separate project of type Web Custom Control Library we added the ability to create a separate assembly to contain the custom button, which can then be used as a reference within our sample web application and also within any other project, allowing for greater code-reuse. It also allows you to create a linkage within the Visual Studio Toolbox for drag/drop operation in the Visual Designer for Webforms.

Read More

Implementing Custom Role Security in ASP.NET 1.x – Part 1

Security is of course an integral part of any application. It is usually designed as part of the abstract application framework during the design phase. There are many different aspects of security in a web application, and most developers, especially network administrators focus on the unknown public portion of security when it comes to design.

You can have firewalls, IP filtering, load balancing, DMZ’s and more when it comes to physical infrastructure with security. Keeping hackers and the general public out of private information and sensitive servers is of course one of the biggest security concerns.

The type of security this tutorial refers to however, is regarding internal user access security. Aside from the obvious security concerns already mentioned, there is often a definite hierarchy of privilege in any company. The different types of users that make up an application can be many. From administrators, so supervisors, to department managers, to regular field workers, all of whom require different levels of security access in your application.

Read More

Display ToolTips on ASP.NET 1.x DataGrids

Presenting data to your users is always an important topic of discussion when it comes to user interface design. Usually a big concern for the GUI developer is how to maximize the available screen space and still maintain a usable interface.

If you try to cram too much information onto one page you will often be left with an interface that requires scrolling, which is a big nuisance for users. With headers and footers, navigation bars, alerts and personalized information taking up valuable screen space the actual amount of usable space on each page is sometimes quite small.

Taking advantage of the space you do have requires some thoughtful design and creativity. A common approach is to display only the most critical information, and if users require more they need to dig deeper. The problem with this approach is that constantly firing post backs to dig down into data can be time consuming for the user.

The purpose of this tutorial is to allow users to view additional information about an item without having to send multiple requests to the server. The term “ToolTip” is probably one you’re familiar with, and is more commonly used in desktop applications, but can also be implemented in web applications with some creativity.

Read More

Formatting Data in a DataGrid for ASP.NET 1.x

So you’ve built yourself a nice little application, you have some cool design patterns implemented, you’ve normalized your database, you have some pretty good CSS layout classes, maybe even a couple user controls for navigation menus, but there’s just one problem remaining: Data presentation.

The trouble is that your data storage is not directly representative of how your users want to view information. A database isn’t really supposed to be used as the place where you “pretty-up” your data presentation. The goal of the database is to just be your work horse. Let it store the data raw and untouched, and massage the presentation after the fact.

Databases often store data in their own format and for the most part you won’t even have control over how it decides to store it. We’ll use SQL Server in this tutorial as our example database. SQL Server can do all kinds of unwanted things to your data when it stores it. One of the most common things is to append 12:00 AM to your date columns unless you manually trim off the data before insertion.

So what happens when you return the data to the user unformatted? They see big ugly 12:00 AM tied to the end of every date in your DataGrids. It takes up space and is completely useless to the user. Unless your date is supposed to store time as well you need to format the dates correctly for the user.

Read More

Ajax WebShop Pattern for ASP.NET 1.1

WebShops and E-commerce online shopping is one of the biggest revenue generating businesses in the world. If you can think of it, chances are you can buy it online. The convenience of being able to purchase anything from a car to a pencil in the comfort of your home without having to travel has made online shopping a massive success.

As a developer you have probably either worked on or been asked to work on a site that has a shopping cart mechanism. Session management is the first thing that comes to mind since you need to persist user selections across multiple requests. Managing this session information in an organized fashion is the first obstacle in shopping cart development.

With ASP.NET 1.1 you also have to deal with the post-back annoyance. Every time a user clicks on a product to add to their cart the entire page needs to be refreshed, and an updated cart total displayed usually somewhere in a top navigation bar.

With Ajax technology now available to ASP.NET 1.1 users through the user of the freely distributable MagicAjax component you can now implement a much more aesthetic version of an online shopping cart without having full page refreshes.

In this tutorial we will be looking at a development pattern, and ‘not’ a complete shopping cart implementation. The goal is to learn the pattern so that you can apply it in different ways to your specific needs.

Read More

SOAP Header Security in ASP.NET 1.x

When working with Web Services one of the more difficult aspects of implementation is security. There are several scenarios of Web Services usage and depending on what your Web Service is intended to do you will require different methods of security.

If your Web Service is intended for public use security is probably not a great concern. If however your target audience is for strict corporate use or even internal use within a single company you will need to make sure your Web Service is not accessed from unauthorized sources.

The first natural thought it to create a login service which can authenticate users before allowing any access to your service methods. One of the biggest annoyances with Web Services and Web requests in general is that state is always destroyed after each request. There’s no simple solution to maintaining a user’s security principle across multiple Web Service requests.

What does this mean in simple terms? It means that you can authenticate on one request but subsequent requests will not be authenticated because the Web Service is not able to “remember” your client. In addition you don’t really want to be sending over user names and passwords as serialized text over the internet.

Fortunately there is a fairly simple alternative called SOAP headers or envelopes. These are sent as separates XML packages with your Web Service requests and can be read by the Web Service separately from the web method parameters.

The purpose of this article is to demonstrate how to use SOAP headers on a Web Service in an ASP.NET application, and, how to implement the header on an ASP.NET client application. The demonstration will be fairly straightforward and will use a login form to create a Web Service security content and use that context object on all Web Service requests.

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

Read More

DataGrid Filtering using Ajax in ASP.NET 1.1

The advent of Ajax has played a crucial role in the progress of web development. Particularly for ASP.NET 1.x developers who are not able to take advantage of the new Ajax related controls added to the .NET framework 2.0.

It has opened an entirely new way to think about how to design a web page. What had been the tradition for years now has to be revisited. Old habits become called into question, you constantly stop and remind yourself, wait, I don’t have to send the entire page back to the server on each request. It is a bizarre concept in some ways but yet the flexibility of this simple concept has revolutionized internet applications.

Suddenly working with the old ASP.NET 1.x controls seems brand new again as you discover new ways to creatively implement them into your application. A web developer can now think more along the lines of a desktop developer. Your design methodology must be completely different and each WebForm needs to be approached with a different concept in mind.

The purpose of this tutorial is to take a simple example using the very common DataGrid control, and use it in a way that would normally never be considered before the advent of Ajax. Using some sample data from the Northwind SQL demonstration database we will bind a list of Customers to a DataGrid control, and allow the user to filter or search by a particular column for partial string data matches, and rebind the results all in a fraction of a second.

Read More
FREE

Free - Creating an Employee Gallery with Pure ASP Upload 3 and Smart Image Processor 2

Richard shows you how to create a wonderful Gallery that can be managed online with Pure ASP Upload 3 and Smart Image Processor 2. The gallery  enables you to upload and automatically resize images online! Read More

Returning Values from Stored Procedures in ASP.NET

When developing larger scale applications it is quite likely that at some point you’ll be working with Microsoft’s SQL Server. Being the enterprise database server of choice for Microsoft based applications odds are you’ll be using either it or MS Access for smaller applications.

During the initial phases of your application framework design you’ll need to decide some best practices and patterns you want to implement when talking back and forth between SQL Server. This is usually where you decide if you’ll be placing all SQL syntax logic into stored procedures or embed them into your application’s code.

Stored procedures are often the method of choice since they have several advantages. The main advantage is that your SQL syntax is not encapsulated in application code. A simple change to some SQL syntax will mean a recompile and redeployment which is an unnecessary procedure when all you want to do is change some simple SQL statement.

Another advantage is speed. In addition to being able to deploy your SQL logic separately from your application code SQL Server can cache and optimize the commonly used and executed stored procedures which will improve your database transaction performance.

If you decide to take the stored procedure route it won’t be long before you encounter 2 common requirements in your application’s database layer. The first requirement usually arises from your GUI developers when they ask you how they can select an item right away after it is created. In other words, give me the primary key from the table where the object was just created.

Read More

Displaying Images with the ASP.NET Repeater Control

Images are often an integral part of an application. Many businesses use image cataloguing as part of their everyday business process, from Insurance companies to automotive sales. Images are also sometimes tricky to handle within ASP.NET applications.

Although there are quite a few methods and controls for managing images and thumbnails the process can be a little obfuscated for developers who are not quite sure where to start, or  which controls to employ to accomplish the task. You really have to get creative sometimes and often what will happen is a particular development strategy that will start out with a good concept but, as it develops, it  becomes more and more unorganized and you wind up with quite a mess in the end.

The purpose of this tutorial is to look at one particular approach for displaying a series of thumbnail images and provide a link to a popup window which will handle displaying the full original image. The goal of this sample application will be to accomplish this requirement in the most simplistic way possible, using the least amount of code to keep things organized and tidy.

The control we will use to implement this sample application will be the Repeater control. For those who are familiar with classic ASP style programming the Repeater control will be quite familiar. We will use the basic principles behind the Repeater control to implement HTML template chunks which can handle the display of a series of thumbnails contained within a folder.

We will also build a DataTable object that we can directly bind to the Repeater control, since the Repeater can only be used with a data source. During the binding process we will manually manipulate the items in the control so that we can popup a new window when a certain item is clicked and display the original full image.

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

Read More

Pasting ASP Code Into a Template

In this tutorial Richard uses a sample site to show you how to give some style and organisation to it by applying a template and creating a few extra folders. Also you have two more extras in the tutorial: one is a document that explains how to apply the asp code you`ve already created to the template and the other contains the whole sample site.


Read More
Newer articles Older articles