This document provides an introduction to creating web applications using ASP.NET. It discusses using Visual Studio to create an ASP.NET project with an ASPX file and code-behind file. The ASPX file contains the user interface markup, while the code-behind file contains the C# code. It provides an example ASPX file called WebTime.aspx that displays the current time. When the page loads, the Page_Init method in the code-behind file retrieves the current time and sets the text of a Label control. Running the project displays the generated HTML, showing how ASP.NET translates the server-side controls into HTML for the browser.
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
This presentation provides overview of ASP.NET for software development - by software outsourcing company India, iFour Technolab Pvt. Ltd. - http://www.ifourtechnolab.com
CyberLab Training Division :
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial has been prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX. etc
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
For More Details.
Visit: http://www.cyberlabzone.com
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...Nancy Thomas
Website : http://www.todaycourses.com
.Net Online Training Concepts :
NET FUNDAMENTALS
Why .NET?
The .NET initiative
Introduction to .NET framework
Advantages of .NET framework
System requirements
.NET FUNDAMENTALS
Why .NET?
The .NET initiative
Introduction to .NET framework
Advantages of .NET framework
System requirements
INTRODUCTION TO VISUAL STUDIO .NET
Base class libraries
Common language-runtime (CLR)
Microsoft intermediate language (MSIL)
Optimized just-in-time (JIT)
Common type systems (CTS)
Common language specification (CLS)
Compilation and execution of .NET application
Assemblies
Namespace
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)Prof Ansari
“ACTIVE SERVER PAGES OR ASP IS COMMONLY KNOWN AS A TECHNOLOGY THAT ENABLES TO MAKE DYNAMIC AND INTERACTIVE WEB PAGES.”
ASP uses server-side scripting to dynamically produce web pages that are not affected by the type of browser the web site visitor is using.
The default scripting language used for writing ASP is VBScript, although some other languages can also be used like Jscript (Microsoft‟s version of JavaScript).
ASP pages have the extension .asp instead of .htm, when a page with extension .asp is requested by a browser the web server knows to interpret any ASP contained within the web page before sending the HTML produced to the browser.
Any web pages containing ASP cannot be run by just simply opening the page in a web browser. The page must be requested through a web server that supports ASP, this is why ASP stands for Active Server Pages, means no server, no active pages.
Overview of ASP.Net by software outsourcing company indiaJignesh Aakoliya
This presentation provides overview of ASP.NET for software development - by software outsourcing company India, iFour Technolab Pvt. Ltd. - http://www.ifourtechnolab.com
CyberLab Training Division :
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial has been prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX. etc
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
For More Details.
Visit: http://www.cyberlabzone.com
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...Nancy Thomas
Website : http://www.todaycourses.com
.Net Online Training Concepts :
NET FUNDAMENTALS
Why .NET?
The .NET initiative
Introduction to .NET framework
Advantages of .NET framework
System requirements
.NET FUNDAMENTALS
Why .NET?
The .NET initiative
Introduction to .NET framework
Advantages of .NET framework
System requirements
INTRODUCTION TO VISUAL STUDIO .NET
Base class libraries
Common language-runtime (CLR)
Microsoft intermediate language (MSIL)
Optimized just-in-time (JIT)
Common type systems (CTS)
Common language specification (CLS)
Compilation and execution of .NET application
Assemblies
Namespace
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)Prof Ansari
“ACTIVE SERVER PAGES OR ASP IS COMMONLY KNOWN AS A TECHNOLOGY THAT ENABLES TO MAKE DYNAMIC AND INTERACTIVE WEB PAGES.”
ASP uses server-side scripting to dynamically produce web pages that are not affected by the type of browser the web site visitor is using.
The default scripting language used for writing ASP is VBScript, although some other languages can also be used like Jscript (Microsoft‟s version of JavaScript).
ASP pages have the extension .asp instead of .htm, when a page with extension .asp is requested by a browser the web server knows to interpret any ASP contained within the web page before sending the HTML produced to the browser.
Any web pages containing ASP cannot be run by just simply opening the page in a web browser. The page must be requested through a web server that supports ASP, this is why ASP stands for Active Server Pages, means no server, no active pages.
Web applications and web servers, HTML form Development, GET and POST, ASP.NET application, ASP.NET namespaces, creating sample C# web Applications, architecture, Debugging and Tracing of ASP.NET, Introduction to web Form controls. Building Web Services- web service namespaces, building simple web
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
2. About the Course
Objective
Introduction to web programming using the Microsoft®
ASP.NET technology and Microsoft® IIS (Internet
Information Server).
Prerequisite
The programming language will be C#, the participants
are expected to have taken the IT519 or IT528 course
Lectures
Saturday 13:00 – 16:00 at Main Campus FENS G032
Grading
Final Exam (40% ): Last (7th
) week of the course, Saturday
Homework (60% total): 4 homework will be assigned
and they are of different weight depending on their
complexity
3. Outline of the Course
Introduction to web programming and ASP.NET
Create web application using Visual Studio® 2010 and C#
Create and add code-behind file to an ASP.NET web form
Examine common ASP.NET Controls
Connecting to a Database in an ASP.NET application and
ASP.NET Data Controls
Session management
Validation controls
Master pages
Configuring and deploying an ASP.NET web application on
an IIS server
Securing an ASP.NET web application
Introduction to ASP.NET AJAX
Introduction to WCF (Windows Communication
Foundation)
4. Internet Technologies
WWW Architecture
Web Server
Client
Server
Request:
http://www.msn.com/default.html
Response:
<html>…</html>
Network
HTTP
TCP/IP
PC/Mac/Unix
+ Browser (IE, FireFox)
6. ASP Architecture
IIS
(Internet Information Server)
Client
Server
Request:
http://www.msn.com/default.aspx
Response:
<html>…</html>
Network
HTTP
TCP/IP
PC/Mac/Unix
+ Browser (IE, FireFox)
7. Server-Side Code
What is server-side code?
Software that runs on the
server, not the client
Receives input from
URL parameters
HTML form data
Can access server-side
databases, e-mail servers,
files, mainframes, etc.
Dynamically builds a
custom HTML response
for a client
HTTP request
(form data,
HTTP
header data)
HTTP response
HTML, XML
ASP page
(static HTML,
server-side
logic)
8. ASP.NET Overview and Features
ASP.NET provides services to allow the creation,
deployment, and execution of
Web Applications and Web Services
Web Applications are built using Web Forms
Web Forms are designed to make building
web-based applications as easy as building Visual Basic
applications
Built on .NET Framework: any .NET programming
language can be used (C#, Visual Basic)
Complete object model
Separation of code and UI
Maintains page state
Session management
Caching, Debugging, Extensibility
9. WebTime.aspx Example
Creating an ASP.NET Web Application using Visual Studio
Step 1: Creating the Web Application Project
Select File > New Web Site... and choose ASP.NET Empty Web Site
in the Templates pane.
Select File System from the drop-down list closest to Location.
Set the Language to Visual C#, and click OK.
10. WebTime.aspx Example
Add n ASPX file (i.e., Web Form), default named
Default.aspx is created for each new project.
Visual Web Developer creates a code-behind file named
Default.aspx.cs.
The View Designer button opens the Web Form in Design
mode.
The Copy Web Site button allows you to copy the project’s
files to another location, such as a remote web server.
Finally, the ASP.NET Configuration button takes you
to the Web Site Administration Tool.
Look at Toolbox displayed in the IDE when the project loads.
Standard and Data list of web controls.
11. Editing the WebTime.aspx
When the project loads for the first time, the Web Forms
Designer displays the autogenerated ASPX file in Source
mode.
Design mode indicates the XHTML element where the cursor
is currently located.
You can also view both the markup and the web-page design at
the same time by using Split mode
Right click the ASPX file in the Solution Explorer
and select View Code to open the code-behind file.
12. WebTime.aspx Example
Let’s create our first ASP.NET page using Visual Studio
1. Modify title of the page
2. Add a heading <h2>
3. Look at the page in Design and Split modes
4. Add a Label control from the Toolbox
5. Change ID of the Label control
6. Change some physical properties of the Label
control
7. Go to WebTime.aspx.cs file and add Page_Init
function to set Text property of the Label control
13. WebTime.aspx Example
Changing the Title of the Page
We change the page’s title from the default Untitled Page to A Simple Web
Form Example.
Open the ASPX file in Source mode and modify the text between the <title>
tags.
Alternatively, you can modify the Web Form’s Title property in the
Properties window.
To view the Web Form’s properties, select DOCUMENT from the drop-down
list in the Properties window.
Designing the Page
To add controls to the page, you can drag and drop them from the Toolbox
onto the Web Form in Design mode.
Like the Web Form itself, each control is an object that has properties,
methods and events.
You can type text directly on a Web Form at the cursor location or insert
XHTML elements using menu commands.
14. Renaming the WebTime.aspx
Renaming the ASPX File
Right click the ASPX file in the Solution Explorer and select
Rename.
Enter the new file name WebTime.aspx and press Enter. Both
the ASPX file and the code-behind file are updated.
Renaming the Class in the Code-Behind File and Updating
the ASPX File
Visual Studio’s refactoring tool, which automatically
updates the existing references to this class in the rest of
the project to reflect this change.
Right click the class name in the partial class’s
declaration and select Refactor > Rename… to open the
Rename dialog.
15. 15
1 <%-- WebTime.aspx --%>
2 <%-- A page that displays the current time in a Label. --%>
3 <%@ Page Language="C#" AutoEventWireup="true"
CodeFile="WebTime.aspx.cs"
4 Inherits="WebTime" EnableSessionState="False" %>
5
6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8
9 <html xmlns="http://www.w3.org/1999/xhtml">
10 <head runat="server">
11 <title>A Simple Web Form Example</title>
12 </head>
13 <body>
14 <form id="form1" runat="server">
15 <div>
16 <h2>Current time on the web server:</h2>
WebTime.aspx ( 1 of 2 )
Visual Studio generates the markup shown when
you create the GUI.
ASP.NET comments
begin with <%-- and
terminate with --%>,
and can span multiple
lines.
The Page directive
specifies information
needed by ASP.NET
to process this file.
ASPX file that displays the web server’s time.
The document type
declaration, which specifies
the document element name
and the PUBLIC URI for the
DTD that defines the
XHTML vocabulary.
XHTML documents
have the root element
html and markup
information about the
document in the head
element.
The body contains
the main content
that the browser
displays.
The form that contains our
XHTML text and controls is set
to execute on the server, which
generates equivalent XHTML.
16. 17 <p>
18 <asp:Label ID="timeLabel" runat="server" BackColor="Black"
19 Font-Size="XX-Large" ForeColor="Yellow"
20 EnableViewState="False"></asp:Label>
21 </p>
22 </div>
23 </form>
24 </body>
25 </html>
WebTime.aspx
( 2 of 2 )
ASPX file that displays the web server’s time. (Part 2 of 2. )
Markup for a label
web control.The asp: tag prefix
indicates that the
label is an ASP.NET
web control, not an
XHTML element.
• In an ASPX file a directive is delimited by <%@ and %>.
17. WebTime.aspx Example
Examining an ASPX File
The Page directive’s Language attribute specifies the
code-behind file’s language.
The CodeFile attribute specifies the code-behind filename.
When AutoEventWireup is true, ASP.NET automatically treats
a method of name Page_eventName as an event handler.
When AutoEvent-Wireup is set to false, you specify event
handlers using attributes in the Page directive just as you
would any other web control.
The Inherits attribute (line 4) specifies the class in the code-
behind file from which this ASP.NET class inherits.
18. WebTime.aspx Example
The document type declaration, which specifies the document
element name and the PUBLIC URI for the DTD that defines
the XHTML vocabulary.
XHTML documents have the root element html and markup
information about the document in the head element.
Setting the runat attribute to "server" indicates that ASP.NET
processes the element and its nested elements and generates
the corresponding XHTML.
The body contains the main content that the browser displays.
The form that contains our XHTML text and controls is set to
execute on the server, which generates equivalent XHTML.
19. WebTime.aspx Example
The ID attribute assigns a name to a control, used as an
identifier in the code-behind file.
The asp: tag prefix indicates that the label is an ASP.NET
web control, not an XHTML element.
Each web control maps to a corresponding XHTML
element or group of elements.
20. WebTime.aspx Example
The asp:Label control is written as an XHTML span
element.
A span element contains text with formatting styles.
This control is processed on the server so that the
server can translate the control into XHTML.
If this is not supported, the asp:Label element is
written as text to the client.
21. 1 // WebTime.aspx.cs
2 // Code-behind file for a page that displays the current time.
3 using System;
4
5 public partial class WebTime : System.Web.UI.Page
6 {
7 // initializes the contents of the page
8 protected void Page_Init( object sender, EventArgs e )
9 {
10 // display the server's current time in timeLabel
11 timeLabel.Text = DateTime.Now.ToString( "hh:mm:ss" );
12 } // end method Page_Init
13 } // end class WebTime
The code-behind file (WebTime.aspx.cs)
Code-behind file for a page that displays
the web server’s time. (Part 1 of 2.)
The Page_Init
method handles the
page’s Init event,
which indicates that
the page is ready to
be initialized.
Retrieve the current
time and formats it
as hh:mm:ss.
22. • The Page_Init method handles the page’s Init event,
which indicates that the page is ready to be initialized.
WebTime.aspx Example Run
23. WebTime.aspx Example
Relationship Between an ASPX File and a
Code Behind File
The code-behind file inherits from Page, which defines the
general functionality of a web page.
The code-behind file contains a partial class.
ASP.NET generates another partial class that defines the
remainder of that class, based on the markup in the ASPX file.
The first time the web page is requested, this class is
compiled, and an instance is created.
This instance represents our page—it creates the XHTML that
is sent to the client.
Once an instance of the web page has been created, multiple
clients can use it to access the page—no recompilation is
necessary.
24. WebTime.aspx Example
How the Code in an ASP.NET Web Page Executes
When an instance of the page is created, the PreInit event
occurs first, invoking method Page_PreInit, which can be used to set a
page’s theme.
The Init event occurs next, invoking method Page_Init, which is used
to initialize objects and other aspects of the page.
Next, the Load event occurs, and the Page_Load event handler
executes.
The Init event is raised only once (when the page is first requested).
The Load event is raised with every request.
The page then processes any events that are generated by the page’s
controls.
Once a response has been generated and sent, an Unload event
occurs, which calls Page_Unload, which typically releases resources
used by the page.
25. WebTime.aspx Example
To view the XHTML generated by ASP.NET, select View
Source from the Page menu ) in Internet Explorer
(or View > Page Source if you are using Firefox).
Nonvisual form components, called hidden inputs, store
data that the user doesn’t need to see.
Attribute method of the form element specifies the
request method (usually get or post). The action
attribute identifies the resource that will be requested
when a form is submitted.
26. 1 <!-- WebTime.html -->
2 <!-- The XHTML generated when WebTime.aspx is loaded. -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
4 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <title>A Simple Web Form Example</title>
9 </head>
10 <body>
11 <form method="post" action="WebTime.aspx" id="form1">
12 <div>
13 <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value=
14 "/wEPDwUJODExMDE5NzY5ZGQ4n4mht8D7Eqxn73tM5LDnstPlCg==" />
15 </div>
WebTime.html
( 1 of 2 )
• Figure shows the XHTML generated by ASP.NET when
a web browser requests WebTime.aspx.
Fig. | XHTML response when the browser requests
WebTime.aspx. (Part 1 of 2. )
Nonvisual form
components, called
hidden inputs,
store data that the
user doesn’t need
to see.
Attribute method
of the form
element specifies
the request method
(usually get or
post). The
action attribute
identifies the
resource that will
be requested when
a form is
submitted.
27. 16
17 <div>
18 <h2>Current time on the web server:</h2>
19 <p>
20 <span id="timeLabel" style="color:Yellow;
21 background-color:Black;font-size:XX-Large;">
22 03:11:49
23 </span>
24 </p>
25 </div>
26 </form>
27 </body>
28 </html>
WebTime.html
( 2 of 2 )
Fig. | XHTML response when the browser requests
WebTime.aspx. (Part 2 of 2. )
The form contains a
span element to
represent the text in
the label. Formatting
properties of
timeLabel are
converted into the
style attribute of
the span element.
28. WebTime.aspx Example
When the form is processed on the server, the runat
attribute is removed.
Only those elements marked in the ASPX file with
runat="server" are modified or replaced in the
generated XHTML.
29. WebTime.aspx Example
The positions of controls and other elements are relative to
the Web Form’s upper-left corner. This type of layout is
known as relative positioning.
An alternate type of layout is known as absolute positioning,
in which controls are located exactly where they are dropped
on the Web Form.
You can enable absolute positioning in Design mode in the
HTML Designer > CSS Styling node of the Options dialog.
Absolute positioning is discouraged, because pages designed
in this manner may not render correctly in different
browsers or on computers with different screen resolutions
and font sizes.
30. Running WebTime.aspx Example
Running the Program
You can view the Web Form several ways.
You can select Debug > Start Without Debugging, which
runs the application by opening it in a browser window.
To debug your application, you can select Debug > Start
Debugging. You cannot debug a web application unless
debugging is explicitly enabled by the web.config file.
To view a specific ASPX file, you can right click either the
Web Forms Designer or the ASPX file name and select View
In Browser.
Finally, you can run your application by opening a browser
window and typing the web page’s URL in the Address field.
31. Event Handling
GUIs are event driven.
When the user interacts with a GUI component, the
event drives the program to perform a task.
A method that performs a task in response to an event is
called an event handler.
32. Let’s create another ASP.NET page using Visual Studio
1. Add a Button and a Label control
2. To create this click event handler, double click the
Button on the Form.
3. The following empty event handler is declared:
4. Set the Text property of the Label control with the
current time in this function.
protected void Button1_Click(object sender,
EventArgs e)
{
}
Event Handling Example (HelloWorld)
33. Event Handling Example (HelloWorld)
To add an event handler, alternatively in markup
(aspx) file:
1. Add a onclick="BClick" property to the Button
control.
2. Add a function BClick to the page class in the code
behind.
34. HelloWorld Example
<%-- Hello World page that also displays the current time. --%>
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="HelloWorld.aspx.cs" Inherits="HelloWorldPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Hello World Web Form</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="buttonClick" runat="server" Font-Size="Medium"
Width="102px“ Text="Click Me" onclick="BClick" />
<br />
<asp:Label ID="labelHello" runat="server"></asp:Label>
</form>
</body> </html>
ASP.NET comments begin with <%-- and
terminate with --%>, and can span multiple lines.
The Page directive
specifies information
needed by ASP.NET
to process this file.
XHTML documents have the
root element html and markup
information about the document
in the head element.
The body contains the main content
that the browser displays.
The form that contains our XHTML text
and controls is set to execute on the server,
which generates equivalent XHTML.
Markup for label &
button web controls.
The asp: tag prefix indicates that the label is an
ASP.NET web control, not an XHTML element.
35. ASPX Code Behind File
public partial class HelloWorldPage :
System.Web.UI.Page
{
protected void BClick(object sender, EventArgs e)
{
labelHello.Text = "Hello World! Time is " +
DateTime.Now;
}
}
36. Event Handling
By convention, C# names the event-handler method as
objectName_eventName (e.g., Button1_Click).
Each event handler receives two parameters when it is
called:
An object reference named sender—a reference to the
object that generated the event.
A reference to an object of type EventArgs, which
contains additional information about the event.
37. Other Ways to Create Event
Handlers
Typically, controls can generate many different types of
events.
Clicking the Events icon (the lightning-bolt icon) in the
Properties window, displays all the events for the selected
control.
38. 38
Locating Event Information
To learn about the events raised by a control, select Help >
Index.
In the window, select Web Development (.NET) in the
Filtered by drop-down list and enter the name of the control’s
class in the Index window.
39. Programming Model
Controls and Events
Button
List
Label
Browser ASP.NET
Button code
...
List code
...
Label code
...
Event handlers
40. ASP.NET Architecture
Common Language Specification
Common Language Runtime
VB C++ C#
ASP.NET: Web Services
and Web Forms
JScript …
Windows
Forms
Base Classes
ADO.NET: Data and XML
VisualStudio.NET
41. Programming Model
ASP.NET Object Model
Controls are objects, available in
server-side code
Derived from System.Web.UI.Control
The web page is an object too
Derived from System.Web.UI.Page
User code executes on the web server in
page or control event handlers
1- Generate the page using the ToolBox in Design mode: add a button and a label
2- Then show aspx markup, run the page
3- Add onClick event using the Design mode and show events
4- Explain code behind file default.aspx.cs: class derives from System.Web.UI.Page
5- set labelHello.Text = “Hello World!”
6- then set labelHello.Text = “Hello World! Time is %s” + DateTime.Now
1- Generate the page using the ToolBox in Design mode: add a button and a label
2- Then show aspx markup, run the page
3- Add onClick event using the Design mode and show events
4- Explain code behind file default.aspx.cs: class derives from System.Web.UI.Page
5- set labelHello.Text = “Hello World!”
6- then set labelHello.Text = “Hello World! Time is %s” + DateTime.Now
1- Generate the page using the ToolBox in Design mode: add a button and a label
2- Then show aspx markup, run the page
3- Add onClick event using the Design mode and show events
4- Explain code behind file default.aspx.cs: class derives from System.Web.UI.Page
5- set labelHello.Text = “Hello World!”
6- then set labelHello.Text = “Hello World! Time is %s” +
ASP.NET is built upon
.NET Framework
Internet Information Server (IIS)