Chapter 1.0-What is Asp.Net

Add to Favourites
Post to:
Join the .NET Community

Description
What is Asp.Net.

Comments
Presentation Transcript Presentation Transcript

Chapter 1.0 : Chapter 1.0 What is Asp.Net 1

Slide 2 : ASP.NET offers a novel programming model and infrastructure that facilitates a powerful New class of applications. ASP.NET is a compiled. NET-based environment, so one can Author applications in any .NET compatible language, including Visual Basic, C# and Jscript.NET. With the aid of Microsoft Visual Studio.NET Web development becomes easier. Web Forms permits us to build powerful forms-based Web pages. When building these pages, we can use Web Forms controls to create common UI elements and program them for common tasks. These controls permit us to rapidly build up a Web Form. What is ASP.NET? 1) ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server. 2) ASP.NET is a Microsoft Technology 3) ASP stands for Active Server Pages 4) ASP.NET is a program that runs inside IIS 5) IIS (Internet Information Services) is Microsoft's Internet server 6) IIS comes as a free component with Windows servers 7) IIS is also a part of Windows 2000 and XP Professional 2

Slide 3 : What is an ASP.NET File? 1) An ASP.NET file is just the same as an HTML file 2) An ASP.NET file can contain HTML, XML, and scripts 3) Scripts in an ASP.NET file are executed on the server 4) An ASP.NET file has the file extension ".aspx" 3

BackgroundWeb Architecture : BackgroundWeb Architecture Web Server PC/Mac/Unix/... + Browser Client Server Request: http://www.digimon.com/default.asp Response: …. Network HTTP, TCP/IP 4

Slide 5 : How Does ASP.NET Work? 1) When a browser requests an HTML file, the server returns the file 2) When a browser requests an ASP.NET file, IIS passes the request to the ASP.NET engine on the server 3) The ASP.NET engine reads the file, line by line, and executes the scripts in the file 4) Finally, the ASP.NET file is returned to the browser as plain HTML The Microsoft .NET Framework 1) The .NET Framework is the infrastructure for the Microsoft .NET platform.  2) The .NET Framework is an environment for building, deploying, and running Web applications and Web Services. 3) Microsoft's first server technology ASP (Active Server Pages), was a powerful and flexible "programming language". But it was too code oriented. It was not an application framework and not an enterprise development tool. 4) The Microsoft .NET Framework was developed to solve this problem. 5

Slide 6 : .NET Frameworks keywords 1) Easier and quicker programming Reduced amount of code Richer server control hierarchy with events 4) Larger class library 5) Better support for development tools The .NET Framework consists of 3 main parts Programming languages: 1) C# (Pronounced C sharp) 2) Visual Basic (VB .NET) Server technologies and client technologies: 1) ASP .NET (Active Server Pages) 2) Windows Forms (Windows desktop solutions) 3) Compact Framework (PDA / Mobile solutions) Development environments: 1) Visual Studio .NET (VS .NET) 6

Slide 7 : WebForms The ASP.NET WebForm is separated into two logical areas: The HTML template A collection of code behind the WebForm The HTML template Contains the design layout, content, and the controls Creates the user interface, or presentation layer Instructs the browser how to format the Web page Is created using a combination of HTML controls, HTML Server controls, Mobile Controls, and ASP.NET controls Server Controls 1) HTML Server controls are similar to the HTML controls, except they are processed by the server 2) Add runat = "server" to the HTML control to transform it into an HTML Server control 3) HTML control: 4) HTML Server control: Yes 5) Server-side programs can interact with the control before it is rendered as a plain HTML control and sent to the browser 7

Slide 8 : The Code Behind 1) Server programs are written in a separate file known as the code behind the page 2) By separating the programming logic and presentation layer, the application becomes easier to maintain 3) Only Server controls can interact with the code behind the page Written in any ASP.NET compatible language such as Visual Basic .NET, C#, Perl, or Java Filename is the same as the WebForm filename Add a file extension that identifies the language Visual Basic .NET use .vb (mypage.aspx.vb) C# use .cs (mypage.aspx.cs) Web Technologies Client-side: HTML / XHTML (Extensible HyperText Markup Language) JavaScript / VBScript (client-side scripting) Server-side: PHP JSP (Java Server Pages) ASP (Active Server Pages) ASP.NET (next generation of ASP) 8

Slide 9 : Server-Side Code 9 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 ASP page (static HTML, server-side logic)

Slide 10 : 10 10 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.

Slide 11 : 11 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 %>.

WebTime.aspx Example : 12 WebTime.aspx Example Examining an ASPX File The Page directive’s Language attribute specifies thecode-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. 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.

Slide 13 : 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. 13 The code-behind file (WebTime.aspx.cs) Code-behind file for a page that displaysthe 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.

Slide 14 : 14 The Page_Init method handles the page’s Init event, which indicats that the page is ready to be initialized. WebTime.aspx Example Run

Running WebTime.aspx Example : 15 15 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.

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Adesh Sharma
A Senior Software Engineer working in a IT company on DOTNET platform
User
1 Member Recommends
6 Followers

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect