Active Server Pages ASP.Net

Slides:



Advertisements
Similar presentations
E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Advertisements

11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Languages for Dynamic Web Documents
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
1 Classic ASP vs. ASP.NET Technical Information and Market Adoption Lance Welker University of San Diego Dr. Rebman MSIT 526 December 20, 2005.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University
CIS 451: ASP.NET Concepts Dr. Ralph D. Westfall January, 2009.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Introduction to ASP.Net ISYS 512. ASP.NET in the.NET Framework 1. The client requests a web page. 2. The web server locates the page. 3. If the page is.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview How to create a first ASP.NET application.
Module 2: Using Microsoft Visual Studio.NET. Overview Overview of Visual Studio.NET Creating an ASP.NET Web Application Project.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
 Lecture  Website language: ASP.net  Book name Beginning ASP.NET 4 in C# and VB 2.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
National College of Science & Information Technology.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Jim Fawcett CSE686 – Internet Programming Spring 2014
Computing with C# and the .NET Framework
ASP.NET Forms.
Jim Fawcett CSE691 – Comparative Platforms Summer 2007
Section 6.3 Server-side Scripting
ASP Explained By: Sarbjit Kaur.
Active Server Pages Computer Science 40S.
Web Forms, HTML, and ASP.NET
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
Web Development in Microsoft Visual Studio 2013
Web Development Using ASP .NET
Browser and Server Models
ASP.NET
Module 10: Creating a Web Application with Web Forms
ASP.NET.
Chapter 9 Programming with Web Forms
Presentation transcript:

Active Server Pages ASP.Net Jim Fawcett CSE686 – Internet Programming Summer 2005

Important Note! You can’t run Asp.Net applications – those with .aspx extensions – from the current college server. It does not have .Net installed. I will be running .Net applications from a new server that does have .Net installed and will become the college server sometime soon. You can run all the applications from the lecture #5 web page, as that links to the new server.

Moving Your Projects Visual Studio, by default, will build Asp.Net applications in two files: Web site files are placed in a folder with the project name under: C:\inetpub\wwwroot. Your solution and project files go in a folder with the project name under: C:\Documents and Settings\YourAccountName\ My Documents\Visual Studio Projects\ You can move the website folder into any parent directory you wish as long as you do two things: Make the new directory virtual and enable annonamous access Edit the WebApplication.csproj.webinfo to provide the correct url. Make sure the Application name shows in the virtual directory properties on the Virtual Directory tab. You may have to hit Remove and Add.

Changing Project Virtual Directories

Server-Side Programs You can run any .Net executable that resides in a virtual directory simply by requesting it from a browser: http://localhost/http://localhost/AspApps/PickCourse/PickForm.aspx Provided that directory permissions allow this. On Windows platforms most server-side processing takes the form of Active Server Page (ASP) applications or ASP.Net applications. Note that the examples I’ve placed on the college server will not run from there, as that server does not have .Net installed. To run the examples, just FTP the code folder to any directory on your local machine, in Windows Explorer right click on the folder, select properties, and select web sharing. Now you can open, for example, drives.aspx with the browser URL: http://localhost/lecture5/drives.aspx

Traditional ASP Traditional (pre .Net) ASP provides interpreted application scripts running in the memory space of the IIS web server. A traditional ASP page consists of a mix of HTML, sent directly to the requesting browser and Javascript or Vbscript executed on the server, usually to generate html for display or interact with a backend database. Traditional ASP uses a set of standard server side COM objects and can use custom COM objects as well. Deploying custom COM objects to remote servers has been a major problem.

Server-Side Objects Traditional ASP provides seven objects used for server-side programming: Application: starts when IIS starts and runs until IIS shuts down ASPError ASPError object is returned by Server.GetLastError(), and has the properties: Source, Category, File, Line, Description, ASPDescription ObjectContext Access to COM+ objects Request: Provides methods: Form(), QueryString(), Cookies(), ServerVariables() Response: Provides methods: Write(), Clear(), End(), Flush(), Redirect(), Buffer, Expires, IsClientConnected(), PICS() Server: Provides methods: Execute(), Transfer(), MapPath(), URLEncode(), HTMLEncode(), GetLastError() Session: starts when a user requests first page and ends with a timeout

ASP .Net ASP.Net supports the traditional style, but adds processing power of compiled C# and a pervasive object model. We can create user-defined classes in C# and use them on ASP pages. Any .Net language can be used this way. Web controls are based on CLR objects. Control state is sent back and forth between client and server. An ASP.Net page can easily be turned into a server control that can be used on any other ASP page. ../lectures/cse686codeL5.htm

ASP Environment

ASP Page Contents An ASP page can contain: Instructions for the server HTML content, intended for the client Code in C#, VB, Jscript.Net. The Code will: generate HTML for client get or send data to a database on this or a remote server interact in some way with the server’s file system Traditional script, e.g.: Javascript or Vbscript Embedded ASP.Net server controls Means to collect information from, and present information to, client Control state is preserved in transactions between client and server Traditional HTML controls Also manages information between client and server. Preserving state requires more work on programmer’s part.

ASP Applications You can build an ASP application using notepad to create an aspx page, a C# code page, and a web.config file. c:\su\cse686\code\AspApps\BasicAsp http://localhost/AspApps/BasicAsp/PickAgain.aspx Most often, you will build ASP solutions using Visual Studio.net.

ASP.Net Application Files An ASP Application generated by the Visual Studio.Net application wizard consists of: A solution in the local directory you chose for building the app: A set of files in a virtual directory on your development machine. When the application is complete you will simply copy these files to the web server you want to use to deploy the application. c:\su\cse686\code\aspapps\pickCourse http://localhost/AspApps/PickCourse/PickForm.aspx

ASP Application Files (continued) WebForm1.aspx An ASP page providing the user interface for the application WebForm1.aspx.cs A C# WebForm, with structure somewhat like a WinForm Web.config Allows you to set debug tracing and other session related properties AssemblyInfo.cs Holds assembly deployment information

Server Controls ASP.Net provides a number of Web controls based on HTML elements and HTML controls. Label, Button, TextBox, DropDownList, ListBox, Image, CheckBox, RadioButton, RadioButtonList, Calendar, Table, Panel, DataList, DataGrid, … These controls have state which is marshalled between client and server in a hidden ViewState variable. Events, like button clicks, that happen on the client side, are marshalled back to the server to trigger event handlers in C#, processed on the server.

Design View

ASPX Code View

C# Code View

Let’s Build an Application Create an ASP.Net Application, using C# Right click on form and set its layout property to flow layout. Pull a TextBox, Button, and Label onto the form. Switch to HTML view and put a couple of <br> tags between each of these controls. Double click on the form to generate a Page_Load event handler and we will put some code there. Double click on the button and we’ll also put some code there. Run the application.

References Programming Microsoft .Net, Jef Prosise, Microsoft Press, 2002 ASP.NET Unleashed, Second Edition, Stephen Walther, SAMS, 2004 ASP.Net, Tips, Tutorials, and Code, Mitchell, et. al., SAMS, 2002 More examples (a lot in Visual Basic.Net, some in C#) than most of the other books available on ASP. www.gotdotnet.com has some interesting tutorial material on ASP.Net.