YOUR FEEDBACK
johnpetersen wrote: Great post. You hit some good points, and hopefully me sending this post. It wil...

SYS-CON.TV
TOP MICROSOFT .NET LINKS


Bring Windows to the Web: Bringing Desktop Apps to Your Web Sites
As .NET 2.0 approaches, which new technologies are worth implementing?

Since the introduction of CGI in 1993, the Web has become an increasingly popular medium for interactive content and application development. The evolution of Web programming has come a long way in 12 years, and new technologies are being introduced on an almost daily basis. As a developer, it can be difficult to determine which new technologies are worth implementing and which should just be left alone.

New technologies afford us new opportunities to make better, more powerful Web applications. The demand for more functionality on Web sites is becoming greater and users now expect Web applications to run more like desktop applications. Web users are becoming dissatisfied with sites that just present a mass of information for them to browse through. They want to have searching, ability to provide feedback, and rating systems. They want ways to interact with the Web; they don't want to just be passive observers.

These new technologies can also help developers become more efficient. Faced with the challenge of reduced IT budgets, smaller teams, and compressed schedules to roll out new Internet and intranet sites and rich Web applications, developers need every advantage tilted in their favor to help their organizational Web strategies succeed. By leveraging the potential of the .NET framework, developers can both improve Web application functionality and take advantage of its object-oriented architecture to streamline and accelerate the development process. This article explains three key features of ASP.NET that you can implement to improve your development team's Web strategy.

Web Sites vs. Web Apps
Developers are quick to use the term Web application to describe just about any project they put on the Web. A Web site isn't a Web application just because it has some dynamic content or a few basic scripts; the term "application" implies a certain amount of interactivity. For example, many news sites contain huge amounts of dynamic information, but they often lack the interaction necessary to consider them Web applications. The content on the site may be managed with a Web app, but the user really doesn't notice any difference between a site with manually added information and one with a content management system. To become an application, it needs to be more than just a collection of static files.

The news site could become a Web application with some additions. Add some searching and indexing features, allow users to create personalized home pages, or create a system for them to give feedback and the site begins to become an application. Users want Web applications that function like their desktop applications. We now have the technology to add these interactive features that people expect from the sites they visit.

The .NET framework allows Web developers to bring many of these desktop application elements into their Web sites. Many might argue that ASP, PHP, and other Web scripting languages can offer the same functionality, but ASP.NET provides not only a more powerful object-oriented environment, but it also helps developers to work more efficiently. Web services also help .NET connect with other Web and desktop applications.

Using Visual Studio .NET
There is a wide variety of Web development applications in use today that range from simple text editors to full featured WYSIWYG applications such as DreamWeaver. Chances are if you're not already creating ASP.NET sites, you're not using Visual Studio .NET. However, Visual Studio offers a lot of features that will make developing in ASP.NET much easier.

The first and most obvious advantage of developing in Visual Studio over DreamWeaver or another WYSIWYG is the built-in compiler. When developing in Visual Studio you can build the entire project with a few shortcut keys, whereas in most other applications you have to use an external compiler, which can be a nightmare when debugging. Visual Studio also has code hinting and drag-and-drop functionality for server controls, which definitely help speed things up.

One downside to Visual Studio is its limited WYSIWYG functionality. Visual Studio was built to be a .NET IDE, not a Web design application, so in comparison to Hot Metal and DreamWeaver it's pretty awkward for writing HTML. If you do a significant amount of design or HTML coding, you will likely want to do the majority of your HTML and JavaScript work in whatever application you're currently using for design and use Visual Studio to program.

Developing with Server Controls
If you're familiar with VB.NET or C#, you're probably already familiar with most of the server controls you see in ASP.NET. Server controls are a great feature of ASP.NET because they help reduce code volume and make development a lot more efficient if used well. These controls incorporate both visual and functional elements that are common in Web development such as form elements and validation functions. You can also combine or modify preexisting controls into reusable custom controls.

Let's go over a brief example of a simple Web form with some server controls in it. There are a few things you should notice about the page overall. All of the server controls have the runat="server" attribute; this is required for any elements that will be used by ASP.NET. Each of the controls also needs a unique ID that allows you to reference the control with VB or C#.

The form in Listing 1 has three server controls and two sub routines to handle events from the server controls. Line 17 is a label server control that outputs a span tag that can be used to display messages to the browser.

Line 18 contains a text box control. The text box control outputs a text input to the browser and incorporates some great functionality that would normally require a fair amount of JavaScript. The OnTextChanged attribute assigns an event handler to be run when the text in the text input changes. The AutoPostBack attribute causes the form to automatically post when changes are made. These two attributes allow you to detect if text has been changed and automatically run the appropriate event handler with only one line of code. Line 19 contains a list box control that has very similar attributes to the text box control. Again, the control detects when a change has been made and automatically posts to the server and runs the appropriate event handler.

Now let's take a quick look at the event handlers. You'll notice that the text property is referenced on all three of the server controls - on line 6 for the text box and label controls, and on line 10 for the list box control. The built-in server controls often share these common properties, thereby making it very easy to exchange one for another. For example, changing a radio button to a check box would require only one line of code to be changed.

User Controls
User controls are files that can contain both visual and functional elements and can be used just like the built-server controls. They allow you to combine existing server controls, HTML, and VB or C# code into a reusable control. Some common user controls include login forms, calculators, or display elements. Let's look at an example user control and how it is implemented in the site.

About Bill Rogers
Bill Rogers is founder and CEO of Ektron, Inc (www.ektron.com). Founded in 1998, Ektron has nearly 15,000 customer integrations worldwide.

MICROSOFT .NET LATEST STORIES
In a move that looks tailor-made for an antitrust suit, Microsoft says it’s going to give away a consumer security kit that it’s building code named Morro. It should be available in the second half of next year – probably more like mid-year. The freebie widgetry is supposed to de...
OpenSpan and TIBCO have announced a technology and business partnership designed to extend TIBCO solutions to desktop environments. The partnership will enable TIBCO Service-Oriented Architecture, Business Process Management and Business Optimization solutions to more rapidly integrate...
Tidal Software has announced Intersperse 8.0, a product that monitors J2EE and .NET applications and their transaction component performance to produce meaningful metrics for managing applications and high-level business processes. The product leverages a combination of lightweight Ja...
DataGuise has announced their first masking in place solution for multi-database environments such as Oracle, Microsoft SQL Server, and others. The dgSolution Suite provides secure masking of database content and is designed for the highest level of flexibility and functionality across...
The BlackBerryR Technical Webcast Series is designed to help BlackBerry administrators better manage and leverage the capabilities of their BlackBerry solution. Each webcast is packed with detailed technical information, covering topics that are relevant to you. Our on-demand webcasts ...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING NEWS FROM THE WIRES
Collexis Holdings, Inc. (OTC Bulletin Board: CLXS), a leading developer of semantic search and knowl...