0% found this document useful (0 votes)
6 views13 pages

Prepared By, B.Maaithili Assistant Professor, Department of Information Technology, Saiva Bhanu Kshatriya College, Aruppukottai

This document provides a comprehensive guide on creating and managing ASP.NET web applications using Visual Studio. It covers the steps to create a project, the Visual Studio environment, various ASP.NET file types, directories, directives, and web forms. Additionally, it explains the differences between HTML server controls and web controls, highlighting their functionalities and features.

Uploaded by

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

Prepared By, B.Maaithili Assistant Professor, Department of Information Technology, Saiva Bhanu Kshatriya College, Aruppukottai

This document provides a comprehensive guide on creating and managing ASP.NET web applications using Visual Studio. It covers the steps to create a project, the Visual Studio environment, various ASP.NET file types, directories, directives, and web forms. Additionally, it explains the differences between HTML server controls and web controls, highlighting their functionalities and features.

Uploaded by

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

ASP.

NET
Prepared by,
B.Maaithili
Assistant Professor,
Department of Information Technology,
Saiva Bhanu Kshatriya college, Aruppukottai
ASP.NET – VISUAL STUDIO

To create a Web application project:


• 1. Open Microsoft Visual Studio.
• 2. On the File menu, select New Project.
The New Project dialog box appears.
• 3. Select the Templates -> Visual C# -> Web templates group on the left.
• 4. Choose the ASP.NET Web Application template in the center column.
• 5. Name your project BasicWebApp and click the OK button.
• 6. Next, select the Web Forms template and click the OK button to create the project.
The Visual Studio environment:
• Toolbars : Provide commands for formatting text, finding text, etc.,
• Solution Explorer window: Displays the files and folders in our Web

application.
• Document window: Displays the documents we are working on in

tabbed windows. We can switch between documents by clicking tabs.


• Properties window: Allows to change settings for the page, HTML

elements, controls, and other objects.


• View tabs: Present different views of the same document.
• 1. Design view is a near-WYSIWYG editing surface.
• 2. Source view is the HTML editor for the page.
• 3. Split view displays both Design and the Source view for the

document.
• ToolBox: Provides controls. Toolbox elements are grouped by

common function.
• Server Explorer: Displays database connections.
ASP.NET File Types

File Name Description


• .aspx - These are ASP.NET web pages. They contain the user interface and, optionally, the underlying application code.

• .ascx -These are ASP.NET user controls. User controls are similar to web pages, except that the user can’t access these
files directly. Instead, they must be hosted inside an ASP.NET web page.

• .asmx -These are ASP.NET web services—collections of methods that can be called over the Internet. Web services work
differently than web pages, but they still share the same application resources, configuration settings, and memory.

• web.config - This is the XML-based configuration file for your ASP.NET application. It includes settings for
customizing security, state management, memory management, and much more.

• Global.asax -This is the global application file. We can use this file to define global variables (variables that can be

accessed from any web page in the web application) and react to global events (such as when a web application first starts).

• .cs -These are code-behind files that contain C# code. They allow you to separate the application logic from the user
interface of a web page.
ASP.NET Directories
Directory Description

Bin Contains all the compiled .NET components


(DLLs) that the ASP.NET web application uses.

App_Code Contains source code files that are dynamically


compiled for use in our application.
App_GlobalResources Stores global resources that are accessible to
every page in the web application.
App_LocalResources Stores local resources that are accessible to a
specific page in the web application.
App_WebReferences Stores references to web services that the web
application uses.
App_Data Stores data, including SQL Server 2005 Express
Edition database files and XML files
App_Themes Stores the themes that are used by our web
application
ASP.NET - Directives

ASP.NET directives are instructions to specify optional settings, such as registering a custom control and page

language.

These settings describe how the web forms (.aspx) or user controls (.ascx) pages are processed by the .Net

framework.

The syntax for declaring a directive is:

<%@ directive_name attribute=value [attribute=value] %>


ASP.NET - Directives
Directive Name Descriptions Attributes List Attribute Descriptions

1. Application It defines The name of the class from


application-specific Inherits which to inherit.
attributes.
The text description of the
Description application. Parsers and
compilers ignore this.
The language used in code
Language
blocks.
2. Assembly IT links an assembly
to the page or the The name of the assembly to
Name
application at parse be linked.
time.
The path to the source file to
Src be linked and compiled
dynamically.
ASP.NET - Directives
Directive Name Descriptions Attributes List Attribute Descriptions
3. Control It is used with the The Boolean value that
user controls and AutoEvent enables or disables
appears in the user Wireup automatic association of
control (.ascx) files. events to handlers.

ClassName The file name for the control.

The Boolean value that


enables or disables compiling
Debug
with debug symbols.

The Boolean value that


indicates whether view state
EnableViewState
is maintained across page
requests.
The class from which the
Inherits
control page inherits.
ASP.NET - Directives
Directive Name Descriptions Syntax

4. Implement It indicates that the web page, master page


or user control page must implement the <%@ Implements
specified .Net framework interface.. Interface="interface_name" %>

5. Import IT imports a namespace into a web page, <%@ namespace="System.Drawing"


user control page of application. %>
6. Master It specifies a page file as being the mater
page.
<%@ MasterType attribute="v
7. MasterType It assigns a class name to the Master alue"[attribute="value" ...] %>
property of a page, to make it strongly
typed.
8. OutputCache It controls the output caching policies of a <%@ OutputCache Duration="15"
web page or a user control. VaryByParam="None" %>
9. Reference It indicates that another page or user control
should be compiled and linked to the <%@ Reference Page
current page. ="somepage.aspx" %>

10. Register is used for registering the custom server <%@ Register Src="~/footer.ascx"
controls and user controls. TagName="footer"
TagPrefix="Tfooter" %>
ASP.NET - Directives
Directive Descriptions Attributes List Attribute Descriptions
Name
11. Page It defines the attributes The Boolean value that enables or disables page
specific to the page file AutoEventWireup events that are being automatically bound to
for the page parser and methods; for example, Page_Load.
the compiler.
It enables, disables, or makes session state read-
EnableSessionState
only.

The Boolean value that enables or disables view


EnableViewState
state across page requests.

It enables, disables, or makes session state read-


EnableSessionState
only.

Inherits The class from which the control page inherits.

ClassName The class name for the page.

URL for redirection if an unhandled page exception


ErrorPage
occurs.

Language The programming language for code.


ASP.NET Web Forms
• Web Forms are web pages built on the ASP.NET Technology.
• It executes on the server and generates output to the browser.
• It is compatible to any browser to any language supported

by .NET common language runtime.


• It is flexible and allows us to create and add custom controls.
• We can use Visual Studio to create ASP.NET Web Forms.
• It is an IDE (Integrated Development Environment) that allows us

to drag and drop server controls to the web forms.


• It also allows us to set properties, events and methods for the

controls.
• Web Forms are made up of two components: the visual portion

(the ASPX file), and the code behind the form, which resides in a

separate class file.


• The main purpose of Web Forms is to overcome the limitations of

ASP and separate view from the application logic Framework


Web Controls

ASP.NET provides various controls like: server controls and HTML controls for the Web Forms.

HTML Server Controls: Web Controls:

• These are server-based equivalents for • These are similar to the HTML server controls, but

standard HTML elements. they provide a richer object model with a variety

of properties for style and formatting details.


• These controls are ideal if you’re a seasoned
• They also provide more events and more closely
web programmer who prefers to work with
resemble the controls used for Windows
familiar HTML tags (at least at first).
development.
• They are also useful when migrating
• Web controls also feature some user interface
ordinary HTML pages or ASP pages to
elements that have no direct HTML equivalent,
ASP.NET, because they require the fewest
such as the GridView, Calendar, and validation
changes. controls.
HTML SERVER CONTROLS
HTML server controls provide an object Interface
for standard HTML elements.
They provide three key features:
• They generate their own interface
• They retain their state
• They fire server-side events

You might also like