0% found this document useful (0 votes)
10 views12 pages

Introduction to ASP.NET Framework

ASP.NET is a server-side web application framework by Microsoft for building dynamic web applications using languages like C# and VB.NET. Key features include server-side technology, object-oriented programming, security, and cross-platform capabilities with ASP.NET Core. The framework supports various application types such as Web Forms, MVC, and Web API, and offers a rich set of controls for rapid development and state management.

Uploaded by

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

Introduction to ASP.NET Framework

ASP.NET is a server-side web application framework by Microsoft for building dynamic web applications using languages like C# and VB.NET. Key features include server-side technology, object-oriented programming, security, and cross-platform capabilities with ASP.NET Core. The framework supports various application types such as Web Forms, MVC, and Web API, and offers a rich set of controls for rapid development and state management.

Uploaded by

bsuresh2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1

UNIT II : INTRODUCTION OF [Link]

[Link] is a server-side web application framework developed by Microsoft, used to


build dynamic, interactive, and data-driven web applications and services. It is part of
the .NET framework and allows to create web solutions using programming languages
like C# or [Link]. [Link] pages have the extension .aspx and are normally written in C#

Key Features of [Link]

1. Server-Side Technology
o Code runs on the web server, and the final output (HTML, CSS,
JavaScript) is sent to the client browser.
2. Object-Oriented
o Built on the .NET framework, [Link] supports object-oriented
programming, improving maintainability and scalability.
3. Rich Toolbox
o Provides controls like text boxes, buttons, grids, and data controls for
faster development in Visual Studio.
4. Security
o Built-in authentication, authorization, and data validation features.
5. Language Support
o Developers can use C#, [Link], or F# to write web applications.
6. State Management
o Supports ViewState, Session, Cookies, and Caching for managing user
data across requests.
7. Cross-Platform (with [Link] Core)
o Traditional [Link] works mainly on Windows servers, but [Link]
Core runs on Windows, Linux, and macOS.

[Link] Application Types

1. [Link] Web Forms


o Event-driven, drag-and-drop development.
2. [Link] MVC (Model-View-Controller)
o Separates application into Model, View, Controller → good for testability
and scalability.
3. [Link] Web API
o Used to build RESTful services and APIs for mobile and web clients.
4. [Link] Core
o Modern, lightweight, high-performance, cross-platform framework.

Advantages of [Link]

 Rapid application development with Visual Studio.


 Strong integration with databases (e.g., SQL Server).
 High security and performance.
 Scalability for enterprise applications.
 Classic ASP: It is the first server side scripting language developed
by Microsoft.
2

 [Link]: It is web development framework and successor of Classic ASP.


[Link] 4.6 is the latest version.
 [Link] Core: In November 2015, Microsoft released the 5.0 version of
[Link] which get separated later and known as [Link] Core. Also, it is
considered as an important redesign of [Link] with the feature of open-source
and cross-platform. Before this version, [Link] is only considered as Windows-
only version.
 [Link] Web Forms: These are the event-driven application model which are not
considered a part of the new [Link] Core. These are used to provide the server-
side events and controls to develop a web application.
 [Link] MVC: It is the Model-View-Controller application model which can be
merged with the new [Link] Core. It is used to build dynamic websites as it
provides fast development.
 [Link] Web Pages: These are the single page application which can be merged
into [Link] Core.
 [Link] API: It is the Web Application Programming Interface(API).

In [Link], development is typically done through an IDE (Integrated Development


Environment) such as Visual Studio or Visual Studio Code. Let me break down your query
into two parts:

1. IDE for [Link] : The main IDEs used are:

 Visual Studio (VS) – Full-featured IDE with GUI designers, debugging, NuGet,
IntelliSense, etc.
 Visual Studio Code (VS Code) – Lightweight, cross-platform editor with extensions
for .NET Core/[Link] Core.

2. Languages Supported in [Link]

[Link] is a language-independent framework, so multiple .NET languages can be used.


Common ones are:

 C# (C-Sharp) – Most widely used language for [Link] web apps.


 [Link] – Visual Basic, still supported but less popular today.
 F# – Functional-first language, can be used in [Link] Core.
 J# (deprecated) – Used in earlier .NET versions, now obsolete.
 Any .NET-compliant language can theoretically be used.

3. Components in [Link]

[Link] provides different programming models and components for building web
applications:

A. Web Forms ([Link] Framework)

 Uses drag-and-drop UI design (event-driven model).


 Components: Server Controls, HTML Controls, Validation Controls, Data
Controls, Master Pages, User Controls.
3

B. [Link] MVC

 Model-View-Controller pattern.
 Components: Model, View, Controller, Routing, Filters, Helpers, View Engines
(Razor/ASPX).

C. [Link] Core

 Cross-platform, modern framework.


 Components:
o Middleware (request pipeline).
o Razor Pages (page-based coding model).
o Tag Helpers (server-side processing in HTML).
o Blazor (C# for client-side web apps, alternative to JavaScript).
o Entity Framework Core (for database access).
o SignalR (for real-time apps).

D. Common Components Across [Link]

 Authentication & Authorization (Identity, Roles, Claims).


 State Management (Session, ViewState, Cookies, TempData).
 Configuration & Caching.
 Web API / REST API support.
 Deployment & Hosting Tools (IIS, Kestrel, Docker).

In short:IDE → Visual Studio, VS Code

 Languages Supported → C#, [Link], F#, other .NET languages


 Components → Web Forms, MVC, Razor Pages, Blazor, Middleware, Web API,
SignalR, Authentication, State Management, Data Access (Entity Framework), etc.

The IDEs support:

 Languages like Java, Python, JavaScript, C#, C++, Ruby, Go, PHP, Perl,
and many more.
 Code Editor with syntax highlighting, IntelliSense, and code suggestions.
 Debugging tools for troubleshooting.
 GUI/Designer editors for drag-and-drop UI development.
 Build automation and project management.
 Version control integration.
 Extensions/plugins for language and feature support.

Popular multi-language IDEs like Eclipse support C, C++, Perl, Python,


Ruby, PHP, and Java. NetBeans supports Java, PHP, JavaScript, C, C++,
Python, Ruby. Visual Studio supports powerful editing for HTML, CSS,
JavaScript, JSON, PHP, Python, C#, F#, and more. Visual Studio Code
supports hundreds of languages through extensions including C++, C#,
Dart, Go, Java, JavaScript, Python, Ruby, and others. Komodo supports
Perl, Python, Tcl, PHP, Ruby, JavaScript, and others.
4

Key Components typically found in IDEs include:

 Code Editor
 Compiler/Interpreter
 Debugger
 Build Automation tools
 GUI Designer
 Source Code Management integration

Key components and features of an [Link] IDE typically include:


 Code Editor:
A rich text editor with features like syntax highlighting, code completion
(IntelliSense), code snippets, and error checking to assist in writing C#, [Link],
HTML, CSS, and JavaScript code.
 Visual Designer:For designing web forms (ASPX pages) and user interfaces by
dragging and dropping controls, setting properties, and arranging layout.
 Debugger:Tools to identify and fix errors in the code, allowing developers to step
through code execution, inspect variables, and set breakpoints.
 Compiler:To translate the source code into executable code that the web server
can understand and run.
 Project and Solution Management:Features to organize and manage multiple
projects within a solution, including adding and removing files, managing
references, and configuring project settings.
 Database Tools:Integration with database management systems for tasks like
creating and managing databases, writing SQL queries, and interacting with data.
 Version Control Integration:Support for popular version control systems like Git
for collaborative development and code management.
 Deployment Tools: Features to package and deploy the [Link] application to a
web server or cloud platform.
-Working with Web Forms
What are Web Forms in [Link]? [Link] Web Forms is a
framework for building dynamic, data-driven websites and
applications.

 It provides a drag-and-drop, event-driven model similar to Windows Forms.


 Every page is a .aspx file, which contains:
o HTML Markup
o Server Controls (ASP Controls)
o Code-behind file (.cs or .vb)
5

Life Cycle of an [Link] Web Form

1. Page Request – User requests a page.


2. Start – Page properties like IsPostBack are set.
3. Initialization – Controls are initialized.
4. Load – Page and controls are loaded with data.
5. PostBack Event Handling – Handles events like button clicks.
6. Rendering – HTML is generated and sent to the browser.
7. Unload – Cleanup of resources.

Creating a Web Form

1. Create a New Project → Choose [Link] Web Application (.NET Framework).


2. Select Web Forms template.
3. Add a New Web Form → Example: [Link].

Example: [Link]

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="[Link]"


Inherits="[Link]" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>My First Web Form</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblMessage" runat="server" Text="Welcome to [Link] Web
Forms!"></asp:Label><br /><br />
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click"
/><br /><br />
<asp:Label ID="lblOutput" runat="server"></asp:Label>
</div>
</form>
</body>
</html>

Code Behind: [Link]

using System;

namespace WebFormsDemo
{
public partial class Home : [Link]
{
protected void btnSubmit_Click(object sender, EventArgs e)
{
[Link] = "Hello, " + [Link] + "!";
}
}
}
6

📦 Common [Link] Web Form Controls

 asp:Label → Display text.


 asp:TextBox → Input field.
 asp:Button → Trigger actions.
 asp:CheckBox / RadioButton → Select options.
 asp:DropDownList → Drop-down menu.
 asp:GridView → Display tabular data.
 asp:FileUpload → Upload files.

Advantages of Web Forms : Rapid development with drag-and-


drop.

 Event-driven model (like desktop apps).


 Built-in state management (ViewState).
 Rich set of server controls.
 Easy to connect with databases (via DataSource controls).

Working with Web Forms typically involves using an IDE that supports
web development with features for designing, coding, testing, and
debugging web forms.

 Web Forms development is often associated with [Link] technology,


where Visual Studio IDE is prominently used. Visual Studio provides a
drag-and-drop GUI designer for server controls, seamless integration for
writing event-driven code (C# or [Link]), and an integrated debugger for
testing form logic and behavior.
 Visual Studio supports creating [Link] Web Forms that allow developers
to build rich, interactive web pages with controls like text boxes, buttons,
dropdowns, validation controls, and more. Its form designer makes
arranging controls easy without manually coding HTML.
 Other IDEs also support web form development and frontend web design
such as Visual Studio Code with its rich extensions, WebStorm for
JavaScript/TypeScript forms, and NetBeans or Eclipse for Java-based web
forms. These IDEs provide features like syntax highlighting, code
completion, live preview, and debugging tools.
 Working with web forms involves creating the HTML structure, styling
form controls using CSS, validating user input either client-side or server-
side, and handling form submission to process data on the server.
 IDEs designed for web development often include features like integrated
browser preview, live edits, and support for frontend frameworks to make
creating and testing web forms efficient.

In short, Visual Studio is a popular choice for [Link] Web Forms


development, while other IDEs like Visual Studio Code and WebStorm are
used for HTML/CSS/JavaScript-based web form development with rich
tooling and debugging integration to enhance productivity.
7

[Link] Web Form Standard Controls

[Link] has a rich set of server controls that help in creating interactive web pages.
Its control has properties (appearance, behavior, data) and events (user interactions).

1️⃣ Label Control (<asp:Label>)


 Purpose: Display text.
Properties : Text → Sets the text displayed.
 ForeColor → Font color.
 Font → Font style (Size, Bold, Italic).
 Visible → Show/hide the label.
Events
 Labels do not raise postback events (only display).
2️⃣ TextBox Control (<asp:TextBox>)
 Purpose: Input field for users.
Properties
 Text → Gets/sets the content.
 TextMode → SingleLine, MultiLine, Password.
 MaxLength → Maximum characters allowed.
 ReadOnly → Prevent user editing.
 CssClass → Apply CSS styles.
Events: TextChanged → Fires when text changes and page posts back.
3️⃣ Button Control (<asp:Button>)
 Purpose: Triggers actions.
Properties
 Text → Caption on the button.
 CommandName → Used in Command event (e.g., "Delete", "Update").
 CausesValidation → Determines whether validation is triggered.
Events: Click → Executes when the button is clicked.
 Command → Executes when a command is issued (e.g., in GridView).
4️⃣ LinkButton Control (<asp:LinkButton>)
 Works like Button but displayed as a hyperlink.
Properties
 Same as Button (Text, CommandName, etc.).
Events: Click, Command.
5️⃣ CheckBox Control (<asp:CheckBox>)
 Purpose: Allow user to select/deselect option(s).
Properties
8

 Checked → Boolean (true/false).


 Text → Label next to checkbox.
 AutoPostBack → Whether to trigger event immediately.
Events :CheckedChanged → Fires when selection changes.

6️⃣ RadioButton Control (<asp:RadioButton>)


 Purpose: Select one option from a group.
Properties
 Checked → Selected or not.
 GroupName → Groups multiple radio buttons.
 Text → Displayed label.
Events :CheckedChanged.

7️⃣ DropDownList Control (<asp:DropDownList>)


 Purpose: Select item from a list.
Properties
 Items → Collection of ListItems.
 SelectedItem, SelectedValue → Get chosen value.
 AutoPostBack → Postback on selection change.
Events: SelectedIndexChanged.

8️⃣ ListBox Control (<asp:ListBox>)


 Purpose: Select one or multiple items.
Properties
 Items → Collection of ListItems.
 SelectionMode → Single / Multiple.
 SelectedValue → Selected option.
Events :SelectedIndexChanged.

9️⃣ HyperLink Control (<asp:HyperLink>)


 Purpose: Navigate to another page/URL.
Properties
 NavigateUrl → Destination link.
 Text → Displayed text.
 Target → Open in new window/tab (_blank).
Events :Does not post back (just redirects).
🔟 Image Control (<asp:Image>)
 Purpose: Display an image.
Properties
 ImageUrl → Path of the image.
 AlternateText → Shown if image not available.
 Height, Width.
Events :No postback events.

1️⃣1️⃣ ImageButton Control (<asp:ImageButton>)


 Purpose: Acts like a button with an image.
Properties
 ImageUrl, AlternateText, CommandName.
Events :Click, Command.
9

Control Key Properties Key Events

Text, Enabled, ReadOnly, MaxLength,


TextBox CssClass TextChanged

Text, CommandName,
Button CommandArgument, CssClass Click, Command

Text, ForeColor, BackColor, Visible,


Label CssClass (No user interaction events)

DropDownLis
t SelectedValue, Items, Enabled, CssClass SelectedIndexChanged

CheckBox Checked, Text, Enabled, CssClass CheckedChanged

Checked, GroupName, Text, Enabled,


RadioButton CssClass CheckedChanged

SelectedValue, Items, SelectionMode,


ListBox CssClass SelectedIndexChanged

SelectionChanged, VisibleMonthChanged,
Calendar SelectedDate, VisibleDate, DayStyle DayRender

FileUpload HasFile, PostedFile (No direct events, form submit handles)

In [Link] Web Forms, the standard controls are server-side controls with
rich properties and events that facilitate interactive web applications.
commonly used standard web form controls along with their important
properties and events:

Common Standard Web Form Controls Properties Explained

 Text: Holds display or input text for controls like TextBox, Label, Button.
 Checked: Boolean for CheckBox, RadioButton states.
 SelectedValue: Selected item for list controls.
 Enabled: Enables or disables a control.
 Visible: Controls whether the control is rendered.
 CssClass: Allows applying custom CSS styles.

 CommandName, CommandArgument: Used for identifying commands


in buttons .Events :TextChanged: Fires when TextBox text changes and
postback occurs.
 Click: Button click event.
 Command: Button command event useful for multiple buttons.
 CheckedChanged: Fires when CheckBox/RadioButton state is changed.
10

 SelectedIndexChanged: Fires when the selection item changes in


DropDownList, ListBox.
 SelectionChanged, DayRender: Specific to controls like Calendar for
calendar interaction.

HTML List Controls: There are mainly two categories of list controls in HTML:
1️⃣ Drop-Down List / List Box → <select> + <option>
<select id="cityList" name="cityList" onchange="alert([Link])">
<option value="delhi">Delhi</option>
<option value="mumbai">Mumbai</option>
<option value="chennai">Chennai</option>
</select>
Properties (Attributes)

 id → Unique identifier. name → Name for form submission.


 multiple → Allows multiple selections (listbox). size → No of items visible
 value → Value of the selected option. selected → Marks default selected option.
 disabled → Disables selection.

Events : onchange → Fires when user changes selected option.


 onfocus / onblur → When control gains/loses focus.

2️⃣ Option → <option> <option value="hyd" selected>Hyderabad</option>


Properties : value → Value sent to server.
 label → Alternative label.
 selected → Preselects option.
 disabled → Makes option unavailable.
Events: Options don’t directly fire events → handled through parent <select>.
3️⃣ Unordered List → <ul> with <li> Displays bulleted list.
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Mango</li>
</ul>
Properties: type (deprecated in HTML5, but still works) → bullet style: disc, circle,
square. id, class, style for CSS.

Events: No direct events, but JavaScript can add onclick, onmouseover, etc., to <li>.

4️⃣ Ordered List → <ol> with <li>Displays numbered list.


<ol type="A" start="3">
<li>First</li>
<li>Second</li>
</ol>
Properties: type → 1, A, a, I, i (numbering style).
 start → Starting number/letter.
 reversed → Displays list in descending order.
Events :Like <ul>, events are added to <li> (e.g., onclick).
5️⃣ List Item → <li>: <li onclick="alert('Item clicked')">Orange</li>
Properties: value → Only in ordered lists, sets list item number.
11

id, class, style.


Events :onclick, ondblclick, onmouseover, onmouseout.

In HTML, list controls are used to display and manage collections of items in various
forms. Here is an overview of common HTML list controls, their key properties, and
associated events:Common HTML List Controls and Properties

1. <ul> (Unordered List)


 Properties: No direct properties; holds <li> items.
 Events: Bubble events from child <li> elements (e.g., click).
2. <ol> (Ordered List)
 Properties: type (numbering style), start (starting number), reversed (reverse order).
 Events: Bubble events from child <li> elements.
3. <li> (List Item)
 Properties: value (in ordered list to define numbering).
 Events: Standard HTML element events like click, dblclick, mouseover etc.
4. <select> (Dropdown List)
 Properties:
 options (collection of <option> elements),
 selectedIndex (index of selected option),
 value (selected option's value),
 multiple (allows multi-selection).
 Events:
 onchange: Fires when the selected option changes,
 click, focus, blur, etc.
5. <option> (Option in a Select List)
 Properties:
 value,
 selected,
 disabled,
 label.
 Events: Generally none or from the parent select.
6. <datalist> (List of predefined options for input)
 Properties: Contains multiple <option> elements.
 Events: Handled on associated <input>.
7. <menu> and <menuitem> (Contextual and popup menus)
 Properties: type (context, toolbar), label.
 Events: Various mouse and keyboard events.

Key HTML List Control Events:onchange: Fired when the user selects a different
option in <select> or changes input value.

 onclick: Fired when user clicks on list items or options.


 onfocus/onblur: Fired when the list control gains or loses input focus.
 onkeydown/onkeyup/onkeypress: Keyboard events while interacting with list controls.
 oninput: Fires when the value of an <input> or a control supporting user input changes.
 Mouse events like onmouseover, onmouseout, ondblclick.
12

Control Important Properties Important Events

<ul>, <ol> type, start, reversed (ol only) click, mouseover (on children)

<li> value (in <ol>) click, dblclick, mouseover

<select> options, selectedIndex, value, multiple onchange, click, focus, blur

<option> value, selected, disabled, label N/A (events via <select>)

<datalist> Contains <option> elements Events on linked <input>

<menu> type, label click, contextmenu

These controls combined with JavaScript event handling enable dynamic user
interactions with lists on web pages, including selection changes, multi-selection, and
custom behaviors triggered by user input and mouse or keyboard actions.

You might also like