Code Editors Video Highlights

  • Code Hints / Intellisense
  • Selecting and collapsing regions of code
  • Inserting server controls into code
  • Modifying properties of controls
  • Code Snippets
  • Compiling server-side code

Evaluate Visual Studio

Introduction

Welcome to this product comparison video overview comparing Macromedia’s Dreamweaver Version 8 and Microsoft Visual Studio 2005 Development Packages. This is the second video in this series of videos. This video continues to examine the IDE of each application, specifically, the automatic prompts that appear as code is being typed.

Dreamweaver Section

Let’s start with Dreamweaver.

When working in the document window, in either the code view or the split view, Dreamweaver provides a code hints feature. Code hints are used to auto-complete code tags, attributes, and values as you type, by providing a drop down list of possible entries. This feature works with HTML and CSS and some, but not all, of the ASP.NET controls. There is no support for code hints in XML or programming languages like Visual Basic or C#.

Visual Studio 2005 Section

In Visual Studio 2005, this feature is called "Intellisense" and appears anywhere you are typing in the IDE. Intellisense is available everywhere and works for just about every known file type, not only with HTML pages, but also with programming languages such as Visual Basic and C#. You also have Intellisense support for XML files, CSS, and even inside the Web Config file. Intellisense is great for discovery – this feature lets you discover all of the available options for a setting, acting as a nice helper and reminder anywhere you need it.

Dreamweaver Section

In Dreamweaver, code can be selected by HTML tags, and a selected area of text can be collapsed. Just highlight the lines of code, and a plus minus sign will appear in the left gutter. This allows you to hide any text selection for better readability.

Visual Studio 2005 Section

The code collapse feature also exists in Visual Studio 2005. Only in Visual Studio, you have two options. First, you can code collapse by HTML tags, so for example, you can collapse this table tag and all of its TR and TD tags will be hidden. Second, in the programming languages like Visual Basic and C# Code Editors, you can create a Region tag, which is also collapsible to hide regions of programming code. Like Dreamweaver, Visual Studio 2005 has a feature that will allow you to select a tag and all of that tag’s contents. Simply click the tag at the bottom of the screen to highlight the entire tag.

Dreamweaver Section

Dreamweaver has the ability to add ASP.NET v1.1 server controls by using the Insert menu, tool bar, or tag chooser, available from the Context Menu. When you insert ASP.NET objects, you can configure some of their properties with the tag editor, or by hand-coding. Dreamweaver has no design time support for custom server controls. It cannot effectively address building the C# or Visual Basic code required for the logic in a more fully-functional Web application.

Visual Studio 2005 Section

In Visual Studio 2005, you can create custom server controls using any .NET programming language like Visual Basic or C#. This means that you have no limit to the overall functionality of the application. To build a new server control, you can start from a template. We’ll look at an example of this in the next video.

Dreamweaver Section

Dreamweaver allows you to manipulate primarily the visual properties of a server control, but not all of its properties. For example, we’ll bring up the context menu of this data grid and then use the ‘edit tag’ option. From here we can set the visual properties of the data grid, but we can’t write specific server side code. Also note that Dreamweaver 8 currently has no support for ASP.NET 2 0 controls.

Visual Studio 2005 Section

Visual Studio 2005 has a feature called "Smart Tags" for setting your server control properties. Smart Tags enable to you to point and click to configure server controls in the design view. For example, let’s drag a GridView from the Toolbox to the design surface. Now, if we hover over the GridView, a small Smart Tag arrow appears. Upon clicking it, we can now configure many properties of the GridView. Also, if we select the GridView, the properties pane will allow us to set all visual properties of the GridView, as well as link to server side code that can be written for the GridView. Another example is the DropDownList control. With Smart Tags, you can easily enable auto post-back on the DropDownList. These Smart Tag options are specific to each server control and are tailored to provide quick access to the most important and most commonly used configuration points.

Dreamweaver Section

Dreamweaver supports snippets for HTML, CSS, XML, XHTML, ASP, JSP, PHP, CFML, and JavaScript. Dreamweaver snippets are static in nature; their purpose is to simplify repetitive coding tasks by allowing drag and drop of commonly used snippets of code. Once a snippet is used, it’s identical to manually typing that code. As such, these code snippets can only be used for static content insertion.

Visual Studio 2005 Section

Visual Studio 2005 snippet library supports a programming architecture. Snippets in this environment are based on C# and Visual Basic. Visual Studio snippets can either be static or intelligent and can also work with linked regions where changes from one region will affect another region. An example would be a property; instead of having to write out all of the C# code we can simply begin typing the definition and the code snippet will automatically complete the remainder of our property. We see that automatically, all the code that we will be writing is provided for us and the cursor is left in the position where we can begin to write the getter, and we’ll go ahead and write the setter to round out our solution. And now we have a property that was very easy to write with only two lines of additional code because the majority was provided by the snippet.

Dreamweaver Section

Dreamweaver has no real support for the "code beside" files that get compiled into high performance .NET assemblies. The C# and Visual Basic files provide the logic to handle events happening on the controls and the Web page. There is no code hints support for these files and also no support for compiling these files once they are manually created. The only way to effectively create assemblies in Dreamweaver would be to use the command line version of the C# or Visual Basic compiler. The only reason that these two Visual Basic source code files exist here is that we are working with a project that was originally built using Visual Studio .NET.

Visual Studio 2005 Section

Visual Studio 2005 is designed to let you easily work with source code that can be compiled into .NET assemblies. When a new Web form is created, the "code beside" file is automatically added to the project. Let’s add a check box to this form. Going into design view, we see the check box in place. By double-clicking on the control, a method is automatically written for us. Now we can program the functionality we want to occur on the server when the check box is changed by the end user. We will have it change its text simply when it is clicked. Once we’ve set this page to the Start Page, we can easily run this application to see our code in action. Selecting the check box... the server side code ran and now represents the changed text indicating it was clicked. Visual Studio 2005 offers a full design solution to write server side code, enabling powerful interaction with the end user.

Conclusion

This concludes our comparison of Dreamweaver and Visual Studio 2005 in the IDE for the code editor section.