Infolink

 

Search This Blog

Oct 30, 2012

Exploring the IDE

The best way to familiarize yourself with some of the features of VS .NET is to have a hands-on tour. Visual Studio has a very substantial feature set, however, there are many features of Visual Studio that are commonly used and offer a great productivity boost if used effectively. This section aims to introduce those common items.   


Starting Up

Perform the following steps to create a new Web project:

  1. Start VS .NET.
  2. Click New Project in the Get Started section of the Visual Studio
  3. Start Page. The New Project dialog box appears.
  4. Click the Visual Basic Projects folder in the left pane of the New Project dialog box.
  5. Click the ASP.NET Web Application icon in the Templates window.
  6. Click OK.



Design View

Once you’ve created a new project, Visual Studio should look similar to Figure, depending on the settings in the My Profile section of the Visual Studio Start Page.



You can think of this page designer as analogous to the Form Designer in traditional VB—it is an empty canvas where you build the user interface (UI) by dragging and dropping components onto it. In this sense it is very much the same as the Form Designer, although there are several differences. Web pages do not have specific boundaries like those that can be given to forms, so that they can’t be resized to be larger or smaller.

Because Web applications are viewed in Web browsers, the page can be manipulated in any way that Web browsers can manipulate any other Web page. This is a very significant point, and it is one of the more difficult concepts that needs to be properly understood in the tradition between developing traditional Windows applications and Web applications.

The Design view is technically a WYSIWYG editor (“What You See Is What You Get,” which holds true for the Form Designer in Visual Basic). A control you place on a form will appear in exactly the same place and have exactly the same dimensions as it will when the application is run. Unfortunately, it can often be the case that what you see in the Web Forms Designer is not what you get when you view the page in the browser.   

More often that not, the problem is related to the dimensions of the page—the distances used in the page make it look great in Design view, but when you see it in a browser (which will likely have a much larger viewing area), the distances look completely out of proportion. To add insult to injury, there is no OnResize event that is triggered when the browser is resized, so the page cannot be dynamically redrawn appropriately every time the user resizes the browser. For this reason, the use of HTML tables is crucial in maintaining correct distances, as tables allow specific dimensions to be specified for the entire table, as well as rows and columns.

Design considerations aside (as they apply to all Web pages, not only those developed using the Web Forms Designer), Design view offers a fairly powerful and easy-to-use UI designer. All Web Forms in Visual Studio have two files by default: one to hold the content and another to hold the server-side logic code. The Visual Studio designer ensures that appropriate entries are made in both files when controls are added to the Web Form. This is a major timesaver and relieves much annoyance, as it is very easy to forget to add appropriate entries to the logic code file if an entry is made in the UI file manually.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...