0% found this document useful (0 votes)
11 views

How To Use Visual Studio IDE

Uploaded by

e.mutindamalusi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

How To Use Visual Studio IDE

Uploaded by

e.mutindamalusi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Chapter 2: Microsoft Visual Studio IDE code, although the capabilities are significantly

limited if you do not write code.


2.1 Chapter overview
As a visual design tool, C# .NET allows
❖ The Visual Studio. Net
you to develop applications quickly; this
Development Environment
is called Rapid Application Development (RAD).
❖ Creating a New ASP.NET Project
❖ The Anatomy of a ASP.NET
Application C# is a multi-paradigm, object-oriented
❖ Visual Studio. Net User programming language, implemented on
Interface;Menus, Toolbars, Code Editor the .NET Framework.
Window, Solution Explorer, properties
Window, Output Window The core features and capabilities of Visual
Basic .NET (also called VB.NET) were the driving
2.2 Introduction to Visual studio.NET
force behind the design of Visual Studio
C# .NET is a graphical programming
.NET, which is comprised of four primary
language that lets you build a complete
languages: Visual Basic .NET, Visual C# .NET,
application without writing any source
Visual C++ .NET and Visual J# .NET
In addition to the major languages, Visual 2.3 THE VISUAL STUDIO.NET DEVELOPMENT
ENVIRONMENT
Studio .NET provides the following two
support libraries that are key to Web Visual Studio .NET includes a powerful

and database development: and feature-rich development environment, bringing


together several languages into a seamless whole.
❖ ASP.NET (Active Server Pages .NET)

❖ ADO.NET (ActiveX Data Objects .NET) We shall explore the development


Environment (IDE) in detail, giving you
Visual Studio .NET is a large an introduction to the main features of
development environment that is Visual Studio .NET.
completely self-contained, incorporating all
2.4 CREATING A NEW ASP.NET PROJECT
three languages, numerous libraries, and the
huge .NET Framework library, which was After starting your Visual studio application, Open the

designed to replace the aging Windows New Project dialog by clicking File,

Application Programming Interface (API). New, Project, as shown in Figure 2.0


From the create new dialog that appears, select the
language of development to C#, platform to windows
and project type to wen as shown in figure 2.1 below

fig 2.0: Create new project dialog

Clicking on “create new project option” on the right of Fig 2.1 setting the project parameters
the screen. Select asp.net core application and click the next
button
Give the project an appropriate name, select the
location of the project and check the “place the project
and solution in same directory” check box as shown
below in fig 2.2

Fig 2.3: Configure HTTPs (optional)

Fig 2.2: set project name and location folder Ensure click empty and check configure for HTTPS in
case you are creating a secure application. After that,
Next click the “create” button to which directs you to
the next window click “Create” button to create your application. This
may take some few minutes, be patient as the project is
being created
2.5 THE VISUAL STUDIO.NET FEATURES

The Visual Studio .NET includes features


a standard menu, toolbar, and multiple
windows that can be docked and minimized.

Auto-hide is a particularly nice feature


of Visual Studio .NET, helping to
reduce the number of open windows
in the environment, while still keeping
those windows handy when needed. Fig 2:3-New project at glance

2.5.1 MENUS
Figure 2.3 shows the environment
The main menu for Visual Studio .NET
with a new project ready to go.
is the same for any .NET language for all
programming languages
▪ The File menu was designed to ▪ Build. The Build menu includes the
support the Solution Explorer with commands needed to compile, build and
handling multiple projects at one execute the program on a web browser program
time.
▪ The Edit menu includes the ▪ The Debug menu is used
standard text editing features, such when stepping through a program
as copy, cut, and paste, but also has that has been stopped with a
some advanced features that you will breakpoint or error condition.
find useful, such as outlining and
commenting/uncommenting source code. ▪ Data. The Data menu is useful when
connecting controls to a database
▪ The View menu allows you to or when using an ADO.NET dataset.
switch between the Source Code ▪ The Format menu is a
and ASP.NET Designer edit windows, user-interface menu that helps to align
and also allows you to bring up and format the position and size
dock-able windows that have been of controls.
closed.
▪ The Toolsmenu includes numerous
▪ The Project menu allows you commands that may be needed during
to add new components and files a development project. Most
to the project, such as a new importantly however, is the last item
in the Tools menu, called Options.
ASP.NET forms, databases, controls e.t.c
Use this command to customize the
user interface and settings of your
projects.
from, therefore you will want to display
▪ The Window menu allows you to
select among the open files loaded only those toolbars that are relevant to
into Visual Studio .NET and the project at hand.
arrange the windows on the
screen.
2.5.3 Code Editor Window

This component is loaded with functionality


▪ The Help menu includes numerous
and supports numerous languages. This editor
commands for searching the integrated
is capable of editing just about
help system that comes with Visual
any type of file imaginable with ease (see
Studio .NET. If you are ever stuck
on a strange error message or Figure 2.4).
language feature, you can usually
find help on the item using this menu.

2.5.2 Toolbars

Visual Studio .NET features numerous


toolbars that provide a means to
quickly perform some action by pressing
one of the icons on a toolbar.
There are over 20 toolbars to choose
in earlier versions (see Figure
2.5).

Fig 2.4-code editor window


2.5.4 Solution Explorer
Fig 2.5-solution explorer
This component contains the files and
resources, as well as individual projects, 2.5.5 Properties Window

that are used by your application. The Properties window is part of the
This window was called Project Explorer Windows Forms Designer but very useful
for Windows Forms, as well as for This is the properties box when the <asp:Image>
Web Forms (ASP.NET). Properties are the control that has been selected. The main sections are:
key to designing a custom user ❖ Grouping View – This changes the manner in
interface with controls (see Figure 2.6). which the properties can be viewed, either with
each property in a group (all data properties
its used to allow web programmers set properties of together etc) or by alphabetical order.
different objects in your project ❖ Property View – This displays all the properties
that are available to the control that has been
selected. These are all the “Design” time
properties, some will not be visible as they are
“Run Time” properties; i.e. they can only be set
when the web site is running.
❖ Event View – These are the events that may be
associated with the control. All controls have
standard events such as Load, Init, Prerender etc.

Fig 2.6-properties window


❖ Property Description – This provides a the control loads, the PreRender event is created
description of the property that is currently before the control has been loaded on the screen.
selected. 2.5.6 Output Window

The Event View of a control’s property box allows for The output box shows the output from when the web
the creation of specific handlers for the events that the site is complied. There is also an error list box which
control is able to create. shows the errors that are currently on the site, the
warnings and general messages. This can be very
useful when creating the site as errors can be caught
before the site is compiled.

figure 2.7- output window


The Image control has the following events, the Load, 2.4.6 Design View
Unload, PreRender and Init events are common to all
The Design tab allows the web site to be developed in
controls. For example, the Load event is created when
the development window in a drag-and-drop manner.
This allows controls to be dragged onto the screen, and
then selected so that the properties can be changed or Every ASP .NET control must have two parts defined in
set. the code, the ID and the runat attributes, missing these
2.4.7 Source View will lead to errors.

The source tab changes the development window to It should be noted that ASP .NET tags are not valid

display the HTML. The design view allows for controls XHTML and will fail a validation check. To check to see

to be dragged and placed on the screen with the HTML if an ASP .NET page is XHTML valid the page should be

automatically created. The Source View allows for a run through the server and the HTML source used to

text-based interface allowing for the manipulation of check the page.

the HTML. Therefore, the label control in the code will 2.5.7 Tool box

look like: The Tool Box contains all the “drag and drop” controls
that are available within Visual Studio, these are split
<asp:Label runat=”server” ID=”txtHello” Text=”Hello World></asp:Label>
into different panels, each panel contains a different set
The Label is part of the ASP .NET library of controls and of controls such as “Standard”, contains controls such as
as such, has the prefix of asp:, showing that it is a ASP the label, text box, button, calendar and other
.NET control. commonly used controls. The “Data” panel contains the
controls that are often used to display data such as the
grid view, data list etc. The “Login” panel contains the
controls that are most often used within the menus, tool- bars, and the various windows
authorization and authentication aspects of the web that make Visual Studio .NET a
site. productive and efficient development
2.5.8 Server Explorer tool.

The server explorer contains any connections to


databases that have been setup in Visual Studio as well By learning to customize the
environment to your tastes, you will
as any database files that are contained within the web become more comfortable with the user
site. interface and will learn the new environment
quicker.
The server explorer allows for database management,
specifically of MS SQL Server, allowing the creation of
tables, deletions, inserting of data and the creating of
store procedures.

2.6 Summary
This chapter provided an overview of
Visual Studio .NET and covered the
major features of the development
environment, including the program

You might also like