P. 1


|Views: 9|Likes:
Published by Vidit Khandelwal

More info:

Published by: Vidit Khandelwal on Sep 12, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less









Contents 1. Introduction 2. Web Application Fundamentals 3. Parts of an ASP.NET Web Application 4. ASP.NET Architecture 5. The .NET Framework 6. Creation of ASP.NET Pages. 7. Comparison of ASP and ASP.NET 8. Conclusion

ASP. it also provides a new programming model and infrastructure for more secure. ASP.NET application.NET is a compiled. programs written in any language. type safety.NET. XML Web services enable the exchange of data in client-server or server-server scenarios.NET has been designed to work seamlessly with WYSIWYG HTML editors and other programming tools. Additionally.NET server controls can be used to create common UI elements. and running on any operating system can access XML Web services . or combine these in any way they see fit.NET. simplifying the code of a page. . While ASP. ASP. Introduction ASP. and program them for common tasks. and stable applications. scalable.NET is largely syntax compatible with ASP. it is a unified Web development platform that provides the services necessary for developers to build enterprise-class Web applications. including Visual Basic . ASP. using any component model.NET-based environment. using standards like HTTP and XML messaging to move data across firewalls. C#.NET application. businesses can expose programmatic interfaces to their data or business logic. Web Forms and Web services.NET. but it also provides all the benefits that these tools have to offer. and so on. cache frequently used data.NET is more than the next version of Active Server Pages (ASP). XML Web services are not tied to a particular component technology or object-calling convention. These controls allow to rapidly building a Web Form out of reusable built-in or custom components.NET is the platform used to create Web applications and Web services that run under IIS (Internet Information Service).NET compatible language. and JScript . inheritance. including a GUI that developers can use to drop server controls onto a Web page and fully integrated debugging support. Developers can easily access the benefits of these technologies. the entire . Each is supported by the same infrastructure that allows using authentication schemes.2 1. including Microsoft Visual Studio . which include the managed common language runtime environment. Developer can author applications in any . to name only a few possibilities.NET Framework is available to any ASP. Not only does this make Web development easier. • • Web Forms allows building powerful forms-based Web pages. Developers can choose from the following two features when creating an ASP. or customizes application’s configuration. Using Web services. As a result. which in turn can be obtained and manipulated by client and server applications. An XML Web service provides the means to access server functionality remotely. When building these pages.

2. sending information back and forth. Generally. those early pages were staticvisitors could not interact with them in any way. and it can take orders from the client. There were only HTML pages on any topic .com).htm). Then server processing was introduced.people could share whatever they liked. It can’t provide any dynamic information or processing. Web Application Fundamentals The Internet allows people from all over the world to communicate with each other via their computers. Although this is a marvelous way to communicate and distribute information. A visitor can now interact with database. tables. Dynamic processing The internet works on the client /server model . and determine new types of visitor demographics over the Web. The client requests page (such as index. This allowed interactivity. instant messaging and the World Wide Web. The client receives the document and displays it. This technology has brought about many new possibilities. and it is an integral part of the client/server model. 4. The most common scenario is communication between a server (a computer that holds information) and a client (a computer that wants the information). including images. and forms. web sites were very simple. such as that from a database. calculations it performs and anything else the client may ask for. it’s rather simple and static.Two computers work together. The client locates a Web Server through www. The server simply waits around for someone t request information. The client computer sends a request for information to he server. Web site developers began to build other neat little tricks into their sites. process content. The server sends the requested document. its URL (such as On the other hand in server processing the server takes a look at what it sends before it sends it. Originally. This finally allowed visitors to interact with Web sites. including e-mail. the server then responds to the client with the information that was requested of it.microsoft. static Web request follows these four steps: 1. The server can return dynamic data. but true dynamic content was still lacking. ASP. to perform a task. The Web quickly evolved and new levels of functionality were added. This paradigm is the request/response model. giving rise to guest books and user polls.Net is a server technology that brings together the different pieces of the Web to give Web sites developer more power than ever. and then it returns the data that’s already stored on its hard drive without really looking at what it’s sending. such as image rollovers and dropdown menus. 3. The modified work flow is as follows: .3 2.

htm).net works in this way-it detects actions and responds to them. and on the client. So now we have two places to execute code: on the server.> </script> <head> <body> Welcome to my page </body> </html> If browser supports client side scripting. This code is simply HTML that the browser executes. For example <html> <head> <script language=”JavaScript”> <! -alert (“Hello World”). -. Once it does the server takes action and performs some piece of functionality. Table below outlines the differences client-side and server-side code.4 1. 5. The server waits around for something to happen on the client. 3. The client receives the document and displays it. Client-side processing Client side processing occurs when some programming code in an HTML page is placed the client can understand. ASP. The server translates the results of the processing to HTML and sends the requested document to the client. The client requests page (such as index.com). These two locations of code are distinct and cannot interact with each other. 4. This model is much easier for building applications than using a request/response scenario. it will understand that line 5 is telling it to display message box to the user saying “Hello World”.microsoft. The server examines the requested file and processes any code it contains. . where everything is returned to the clients as HTML. The client locates a Web Server through its URL (such as www. 2. There’s another model for communicating between servers and clients. known as the event-driven model.

5 The differences between Client –side and server –side Location Client-side Description This code isn’t processed at all by the server. That’s solely the client responsibility. Any content or information that this code produces must be converted to plain HTML before sent to the client. Generally used for performing dynamic client effects. Code can be written in scripts as well. such as image rollovers or dynamic message boxes. content an Server-side .net uses compiled languages. Used for processing returning data. Code is written in scripts-plain text commands that instruct the client to do something. but ASP. This code is executed only on the server.

Parts of an ASP.6 3. Content files determine images. ASP. program logic. who has access. The Web form is the key element of a Web application. Executable files.NET Web Application Part Content Types of Files Description Web Forms. the appearance of a other data Web application. like a Windows form.NET Web applications have a dynamic-link library (DLL) file that runs on the server. They can contain static text and images as well as elements that are composed on the fly by the program logic (as in the case of a database query). The configuration files Style sheets. IIS and settings determine settings how the application runs on the server. A Web form is a cross between a regular HTML page and a Windows form: It has the same appearance and similar behavior to an HTML page. Program Logic Configuration Web configuration file. . scripts The program logic determines how the application responds to user actions. Table: Parts of an ASP. and they can also include scripts that run on the client machine. video. how errors are handled.NET Web application. Table below summarizes these parts and gives examples of where they reside in an ASP. but it also has controls that respond to events and run code. audio. and other details. and Web configuration information. HTML.NET Web Application A Web application consists of three parts: content.

and use any other controls that appear on the page. select options. The content portion of the Web form resides in a content directory of the Web server. the executable portion of the Web form is stored in an executable (. the following sequence occurs: IIS starts the Web application’s executable if it is not already running. The executable composes a response to the user based on the content of the Web Forms page that the user requested and any program logic that provides dynamic content. cause the page to be posted back to the server for event processing and the sequence repeats itself.dll) that runs on the server under the control of IIS. as shown in Figure Web Application parts on a Web Server When a user navigates to one of the Web Forms pages from his or her browser. Once the user gets the requested Web form. he or she can enter data.7 In a completed Web application. Some controls. IIS returns the response to the user in the form of HTML. click buttons. such as buttons. as shown in Figure .

if the client is authorized. returns the appropriate resource. all Web clients communicate with ASP. IIS deciphers and optionally authenticates the request. and. IIS also finds the requested resource (such as an ASP.Net Architecture As the illustration shows. .8 How the parts interact 4.NET application). ASP.NET applications through IIS.

Subdirectories inherit a directory's settings unless overridden by a Web.9 Integrating with IIS IIS always assumes that a set of credentials maps to a Windows NT account and uses them to authenticate a user.config.NET provides the two additional types of authentication described in the following table ASP.NET functionality. SHA1. and Integrated Windows Authentication (NTLM or Kerberos). In a Web.NET configuration.config file is in the Config directory of the install root. the request and authentication information are handed off to the application. Web.NET authentication provider Forms authentication Description A system by which unauthenticated requests are redirected to an HTML form using HTTP client-side redirection. MD5]"> <user name="[UserName]" password="[password]"/> </credentials> .NET is contained in files named Web.config and Machine. There are three different kinds of authentication available in IIS 5. If the application authenticates the request.config file is organized as follows: <authentication mode="[Windows/Forms/Passport/None]"> <forms name="[name]" loginUrl="[url]" > <credentials passwordFormat="[Clear. Centralized authentication service provided by Microsoft that offers a single log on and core profile services for member sites. The Machine.config file. they are authenticated and authorized by an ASP. Subsequent requests are issued with the form in the request headers.config can be placed in the same directories as the application files. The security section of a Web.0: basic. ASP. the system issues a form that contains the credentials or a key for reacquiring the identity. digest.NET Configuration Files ASP. Passport authentication Using ASP. If URL is requested containing an ASP. there are sections for each major category of ASP. All configuration information for ASP.NET application. The user provides credentials and submits the form. A developer can select the type of authentication to use in the IIS administrative services.NET handler using whatever validation method the application developer specifies. of which security is a part.config file in the subdirectory. has a hierarchical architecture.

NET Framework.NET application effectively and avoid writing new code to perform tasks that are already implemented within the .NET Framework is the new Microsoft programming platform for developing Windows and Web software. security.NET Framework ASP. but it is just one part.NET Framework. .NET is an important part of the . and remote management . a little background. The .10 </forms> <passport redirectUrl="internal" /> </authentication> <authorization> <allow users="[comma separated list of users]" roles="[comma separated list of roles]"/> <deny users="[comma separated list of users]" roles="[comma separated list of roles]"/> </authorization> <identity impersonate ="[true/false]"/> 5. It is made up of two parts: • • An execution engine called the common language runtime (CLR) A class library that provides core programming functions. and application-level functions used for Web development (ASP.NET). data access (ADO.NET application code is compiled into Microsoft intermediate language . First.NET Framework provides will help programming ASP.NET).NET applications aren’t executed the same way as the traditional Windows applications. Understanding what else the . such as those formerly available only through the Windows API. The . Instead of being compiled into an executable containing native code.

The . Table below summarizes the .NET class library provides access to all the features of the CLR. While running.NET class library is organized into namespaces. rather than statically through the system registry as is done with applications based on the Common Object Model (COM).NET application runs Applications that run under the CLR are called managed code because the CLR takes care of many of the tasks that would have formerly been handled in the application’s executable itself.NET namespaces that are of the most interest to Web application programmers A Summary of the . the CLR provides memory management. Managed code solves the Windows programming problems of component registration and versioning (sometimes called DLL Hell) because the assembly contains all the versioning and type information that the CLR needs to run the application. type-safety checks. At run time. and other run-time tasks for the application.11 (MSIL) and stored in a file called an assembly. The CLR handles registration dynamically at run time. the assembly is compiled to its final state by the CLR. The . Each namespace contains a functionally related group of classes.NET Framework Class Library . Figure shows how this works How a .

NET class library provides access to all the features of the CLR.SqlClient. These classes include methods for converting types. These classes are used when creating peer-to-peer applications Providing user authentication.Data. System.Cryptog raphy. and modifying data Debugging System. System.Security.OleDb. Each namespace contains a functionally related group of classes.IO. System.Sockets Security System.Security Communicating over the Internet using low-level protocols such as TCP/IP. user authorization. System.Common. The . for manipulating strings and arrays.Web. System. Network Communication System.12 The .IO. and numeric types.Net.DirectoryService s Accessing the file system.Data. System. performing commands.Data. Web. Data Access System.NET class library is organized into namespaces. arrays. retrieving data.Diagnostics Debugging and tracing application execution. System.Net.NET namespaces that are of the most interest to Web application programmersCategory Namespaces Provides Classes for Common Types System All the common data types.Security.Data. System. and data encrypting Web Applications System. System. System.SqlTypes Accessing databases.Permiss ions. Table below summarizes the .Policy. These include methods for reading and writing files and getting paths and filenames.IsolatedStora ge. System.Data. Creating client-server applications . including strings. and for math and random number tasks. Security.Security. These classes include methods for connecting to databases. File Access System.

C onfiguration.Web.Web.UI.Web.Pr otocols that run over the Internet.Services.UI.Web. System.Web.WebCon trols.Mail. ASP. System. .UI.D escription. System.Web.Web. System.SessionStat e. System. System.Web. System.Services.Hosting.Web.Web.NET Framework SDK is set up and running.Web.Configurati on.Di scovery.Caching.NET pages can be created easily in ant text editor. System.Web.13 System. These are the core classes used to create ASP. System. System.NET pages are simply pure text.Web. System. System.NET Web applications Web Services Creating coì¥Á135@ and publishing 1313ø ¿13131313131313131313131313 8m131313bjbjÏ2Ï21313131313131 31313131313131313131313 13Ãë 13X1313X1313 e1 313131313131313131313131313 131313131313131313131313131 3ÿÿ¤131313131313131313ÿÿ¤13 1313131313131313ÿÿ¤13131313 13131313131313131313131313ˆ 1313131313”131313131313”1313 ”131313131313”131313131313ä 131313131313ä131313131313ä1 313µ1313131313131313131313ø 13131313131313†131313131313 13†13131313131313†131381313 138†1313l13ì¥Á135@ 1313ø ¿13131313131313131313131313 8m131313bjbjÏ2Ï21313131313131 31313131313131313131313 13Ãë 13X1313X1313 e1 313131313131313131313131313 131313131313131313131313131 3ÿÿ¤131313131313131313ÿÿ¤13 1313131313131313ÿÿ¤13131313 13131313131313131313131313ˆ 1313131313”131313131313”1313 ”131313131313”131313131313ä1 31313131313ä131313131313ä13 13µ1313131313131313131313ø1 3131313131313†1313131313131 3† 13131313131313†131381313138†1313l13SP.NET Pages ASP.UI.Services.Web. Once a Web Server and the .Services.HtmlCon t System.Services. like HTML files.Design.

NET pages must end in . so any files the server to interpret as ASP.aspx such as default.aspx. (default is c:\intetpub\wwwroot\sample.Text.NET pages have the .aspx Example ______________________________________________________________ 1 <%@ Page Language="C#" %> 2 3 <script runat="server"> 4 private void Page_Load (object sender.aspx in virtual directory of IIS.Text="Hello"+ tbMessage. EventArgs e) 5 { 6 lblMessage.Write ("Our First Page").14 ASP.aspx).aspx extension. 7 } 8 </script> 9 10 <html> 11 <body> 12 <% Response. .it can be viewed with the URL http://localhost/sample.Entering the Name in the textbox and clicking Submit a hello message is shown as in figure.%> 13 <form runat="server"> 14 Please enter your name: 15 <asp:textbox id="tbMessage" runat =server/> 16 <asp:button id="btSubmit" Text=Submit runat =server/> 17 <asp:Label id= "lblMessage" runat="server" /> 18 </form> 19 </body> 20 </html> ______________________________________________________________ This page is saved as Sample.

This is known as a code render block. It contains additional instructions that ASP.NET (Integrated Development Environment) allows to manage entire Web sites and it provides features such as deleting virtual directories. which supplies the ASP. Anything contained within a Web Form can be watched over by ASP. As ASP.NET pages. 16 17 we have few new elements that look like HTML elements. It is telling to ASP. This is the code ASP. On Line 13 there is another traditional HTML element .NET pages can be developed in any text editors but they don’t offer many features that would make ASP.NET is C# programming language is used for writing code. This is the content that will be sent to the browser. .NET code to make it easier to read. Lines 3-8 contain a block of code called a code declaration block. HTML begins. working with database.NET uses to process its pages. these are known as Web controls. When this tag is specified the form becomes a Web Form. Microsoft Visual Studio.NET uses to produce output.NET On lines 15.NET development easier.but then there’s that runat=”server” again. On line 1 is <@ Page %> directive.NET with specific information that’s used during the compilation process.15 This page highlights the most common elements found in ASP. it is compiled into MSIL Starting on Line 10. and dragging and dropping HTML components. It even color-codes ASP. Line 12 begins with <% .

ASP. ASP. is an integral part of the operating system under the .It was always a separate entity. which are complied and provide better performance.NET ASP. Some of the general differences between ASP and ASP. so there is no need to register Web applications or COM objects.NET framework handles everything else.NET.NET objects are available for ASP. and therefore its functionality was limited. nearly all code was executed in code render blocks (that is inside < %.NET is its ease of deployment. and all .NET is a complete overhaul of traditional Active Server Pages .16 7.NET separated from the rest of the HTML. this type isn’t compiled and isn’t recommended. Fundamental Changes from ASP (a)Classic ASP was built on top of the Windows operating system and IIS. When deploying classic ASP applications..%> tags). With ASP. It also provides reliability that can even survive server crashes. (c) Furthermore. it passed the HTML to the client and forgot about it. Programmatic Enhancements over ASP (a) One of the biggest enhancements in ASP. the metadata stores all necessary information for applications.NET Framework.NET all the developer need to be done is copy the DLL files.NET code is compiled. Using compiled means an automatic boost in performance over ASP applications.NET. (b)ASP also made it clear that client and server were two separate entities.In ASP.NeT are as follows: 1.NET ties together the client and the server through clever use of server –side code. Comparison of ASP and ASP.EXE to register the components. It shares many of the same objects that traditional applications would use.It address this issue by providing built in session support that’s scalable across Web Forms. which is very difficult to read through an ASP page? Code declaration blocks can be placed right at the top of the page in ASP. Net’s consumption. Instead code declaration blocks. it is needed to copy appropriate DLLs and use REGSVR32. Once ASP finished with work on the server. (c) In classic ASP.. whereas classic ASP used interpreted scripting languages. all invisible to the developer.It offers a very different methodology for building Web Applications. The . . Using these blocks also avoids having code and HTML interspersed throughout the page. 2.NET. on the other hand. (b) Session management has become much easier and more powerful with ASP. ASP. and it can work with browser that doesn’t support cookies.

New Application Models ASP.over 80 mobile Web devices -.17 3.NET is now completely object –oriented. or iMode as required by the requesting device. XML Web services allow applications to communicate and share data over the Internet.using ASP.NET extends application’s reach to new customers and partners. XML Web Services.NET compatible language.NET.NET. Further Developer can author applications in any . Classic ASP strove to introduce the concept of object-oriented programming (OOP). A developer write application just once and the mobile controls automatically generate WAP/WML. 4. and JScript .NET Mobile Controls let easily target cell phones. including Visual Basic . but was unable to because that was a fundamentally different programming paradigm.NET. PDAs -. • . ASP. C#. • Mobile Web Device Support. Difference in Programming Methodologies ASP. HTML. ASP. regardless of operating system or programming language.NET makes exposing and calling XML Web Services simple.

Probably the most significant advantage is its integration with the Windows server and programming tools. Conclusion ASP.NET are easier to create. and deploy because those tasks can all be performed within a single development environment—Visual Studio . With it.NET has many advantages over other platforms when it comes to creating Web applications. Web applications created with ASP.18 8. ASP. debug.NET is an exciting new Web development technology that is going to take the world by storm.NET. display pages on mobile devices (such as cell phones).NET makes designing dynamic Web pages quicker and easier than ever before. and provides many enhancements to take advantage of new technology. a developer can interact with database. and even build an entire e-commerce shopping site from scratch. It is the next generation of Microsoft’s ASP. . This next generation of Web Development technology make designing impressive Web sites an easy and fun process. personalize Web pages for visitors. ASP.

NET framework SDK Documentation. Developing Web Applications with Microsoft Visual Basic.NET by Microsoft Corporation.19 References 1. 3.NET and Visual C#.msdn. Microsoft . .microsoft. http://www.com 2.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->