Asp.net architecture

17,953 views
17,588 views

Published on

Published in: Education
3 Comments
11 Likes
Statistics
Notes
  • Hello Sir,
    plz send this ppt to the email id meetpravinhere@gmail.com.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • sir plz send this ppt to the email id nnn96325@gmail.com and reply me...i need this ppt in coming 2 days. so plzzzzzzzzz
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Thank you so much!!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
17,953
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
0
Comments
3
Likes
11
Embeds 0
No embeds

No notes for slide
  • Th
  • Some of the useful classes in .NET are: Application SystemInformation Clipboard Convert
  • .NET Framework Services: ASP.NET Web Forms Windows Forms ADO.NET XML support throughout. The .NET framework is designed from the ground up for a web services world. XML is natively supported. There is built-in support for building, publishing and consuming web services. With inherent support for web standards such as SOAP and XML, the .Net framework is designed for high availability and reliability, i.e., you have secure mobile code. The programming model is very much simplified resulting in high-productivity application development with lot less plumbing required. It is now easier to deploy, run and maintain your application components, version them as required and have them available to other applications and services. The Object model is built in and not bolted on, so multi-language development becomes simple. There are no additional rules or APIs to learn. Deployment is very much simplified; there is no registration required. So, here’s what’s underneath the covers of our next generation development platform. Lets drill down into each of these boxes and see how they all fit together as the pieces that make up the .Net Framework. Common Language Runtime : the common infrastructure upon which entire .net framework is built. Before COM, applications were completely separate entities with little or no integration COM provides a way for components to integrate. However, each component must provide the “plumbing” and objects cannot directly interact. With the .NET Framework common language runtime, components are built on a common substrate. No “plumbing” is needed and objects can directly interact. The CLR provides a rich run-time environment Riding on the CLR, you have Class libraries : the comprehensive programming interface to .net platform. The .NET framework provides a rich set of class libraries, ADO.NET and XML, and Windows Forms for rich, Win32 applications. ADO.NET: Data and XML - ADO.NET is an evolutionary improvement to ADO that provides platform interoperability and scalable data access. Because XML is the format for transmitting data, any application that can read the XML format can process data. In fact, the receiving component need not be an ADO.NET component at all. It might be a Visual Studio-based solution or any application running on any platform. ASP.NET : unified web development platform that provides the services necessary for developers to build enterprise-class web applications. With the .NET framework, you can now build web services that can then be consumed by any other application independent of platform or location. This is a very powerful way to build, deploy and run scalable, distributed web applications that can run on any browser or device. Programming Languages – all built to a common language specification. The unified programming model results in consistent API availability regardless of language and programming model. It’s possible to have cross language inheritance and exceptions. We have a highly leverage toolset with debuggers etc. working with all languages. We currently have over 20 third party languages supported in the .NET framework including VB, C++, C#, Java, JScript, Perl, COBOL etc. Visual Studio. NET : Finally, supporting the entire platform, is the Visual Studio development environment that can be used to built scalable enterprise applications taking advantage of the rich functionality of the .NET framework. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • ADO classes are now part of .NET Scripts in ASP.NET are executed on the server. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • ADO classes are now part of .NET The old ASP uses interpreted languages to accomplish the construction of the final HTML document before it was sent to the browser. But ASP.NET uses truly compiled language to accomplish the same task. So ASP.NET building web pages based on objects in a compiled environment. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • ADO classes are now part of .NET The SQL Cache invalidation means, Before ASP.NET 2.0 it is possible to cache the results came from SQL server and update the cache based on time interval. In this case within updation period unable to get fresh data. Sometimes even though the data is not changed it need to update. With SQL Cache invalidation when result set from SQL server changes, the output cache is triggered to change and the end user always see the latest result set. The new controls introduced with ASP.NET 2.0 are: New Data controls (GridView, FormView, DetailsView) , Login controls, Navigation controls, Declarative data access controls (SqlDataSource, ObjectDataSource, XmlDataSource controls). To limit wabpages to be viewed by members only a set of new API, Controls and Providers are supported in ASP.NET 2.0 Personalization is closely tied to the membership and role infrastructure. The personalization settings are capable to store either Access or SQL server built into ASP.NET. In ASP.NET 2.0 the navigation made easy by supporting series of site navigation controls. ASP.NET 2.0 now include the capability to automatically precompile your ASP.NET applications directly. Themes are new way to providing a common look and feel to your site across every page. ASP.NET 2.0 supports a couple of providers that allow you to store user information. Here you have flexibility and power to store either in SQL server or Oracle or some other stuff. Basically this provider sits between your control/application and back end database. Some of the providers are: SqlMembershipProvider: It provides you the capability to use the membership system to connect to SQL Server 2000 or SQL Server 2005 SqlRoleProvider XmlSiteMapProvider SqlProfieProvider SqlPersonalizationProvider. To use these providers in your application you have make appropriate configuration through web.config file and reference it from your application. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • ADO classes are now part of .NET 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • Language Integrated Query ( LINQ , pronounced "link") is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages using a syntax reminiscent of SQL. Many of the concepts that LINQ has introduced were originally tested in Microsoft's Cω research project. LINQ was released as a part of .NET Framework 3.5 on November 19, 2007. The ListView new data control that displays data and that provides a highly customizable UI. It combines the many aspects of existing data controls. The ListView control is useful for displaying data in any repeating structure, similar to the DataList and Repeater controls. Unlike those controls, the ListView control supports edit, insert, and delete operations as well as sorting and paging. The paging functionality is provided for ListView by the new DataPager control. The DataPager control is used to page through data that is displayed by a control that implements the IPageableItemContainer interface, such as the ListView control. The DataPager control supports built-in paging UI 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • To support all MSDN documentation is available for Visual Studio. Project management tools for creating and managing application files, including deployment locally, intranet or over the Internet. Just explain about Toolbox, Solution Explorer, Server Explorer, Properties Window. SmartTag support for some controls. Some of the Code Snippets are: Random number generator, Iterating Hash table using For each, Determining is folder exists? To invoke code snippet, right click on code editor, select Insert Snippet, you will find a lot of snippets. The pre compile option allows : You to deploy only executable code. So you protect to your intellectual property (i.e., source code). It finds any compile-time errors in the page are its dependencies. Finally, pre-compiling improves performance and reduces the time it takes for pages in your web site in your web site to render the first time. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • Creating Web site from Visual studio select File  New  WebSite By default present Visual Studio builds the applications without using IIS. These applications uses built-in web server .
  • Just point on Tag Navigator ( At bottom of window allow to switch design and source view ) and Page Tabs. What you see in new Web Site A new website with the name you specified (or the default name) gets created. A folder App_Data is created which will contain data files such as xml and data base files . Default.aspx is already created which is the first page in the web application. Default.aspx.cs is ‘code-behind’ class for Default.aspx . You have design as well as source view for all the asp pages. <form id="form1" runat="server"> </form>
  • Code that is required when the page loads up can be put here Note that there is no link up between the asp.net page and the code here. This is automatically achieved  inferred by the AutoEventWireUp attribute set to true .
  • To add new Web Pages to your web site just right click on your project and select Add new Item from context menu.
  • The single page model is similar to traditional ASP 2.0 and 3.0 models. In Code-behind Page model allows the code separation of page’s business logic from its presentation logic. The presentation logic is stored in “ .aspx ” page. Whereas logical piece is stored in a separate class file “ .aspx.cs ”. An ASP.NET Web page has constitute two files: File containing visual element tags like server controls tags and static text. File containing programming logic for the page, which includes event handlers and other code. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • In Code-behind Page model: An ASP.NET Web page has constitute two files: File containing visual element tags like server controls tags and static text. File containing programming logic for the page, which includes event handlers and other code. Advantages of Single file page model : For a small simple page all code in one file is simpler to handle. Slightly easier to deploy or transfer because you need to send only one file. Because there is no dependency between files, a single-file page is easier to rename. Advantages of Code-behind page model : A clean separation of design and code The design code is usually mark up code which is achieved through visual programming (drag drop). This code is generated automatically by visual studio. This approach keeps the code that programmer writes is kept separate from the code that is automatically generated. Page designers is not exposed to the code that programmers write. Same code can be reused for multiple pages. 06/15/11 10:25 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. Next Generation Business Solutions Platform Strategy Review
  • Trace handler is a handler that displays the current page trace information.
  • Trace handler is a handler that displays the current page trace information.
  • The nice thing about App_Code folder is that if you place in code files in this folder visual studio automatically compiles and make instantly available to your ASP.NET pages that are in some location. Every thing placed in App_Code folder compiles to a single assembly. If you want to develop classes that uses different languages (VB, C#) then you need to create different directories ( VB and CS ) in App_code folder and place files accordingly. ( \\App_Code\\VB or \\App_Code\\CS , etc., ). Also you need to make some settings in web.config file to generate different assemblies for different codes. Themes are new way to providing a common look and feel to your site across every page. In addition to App_GlobalResources folder there is also an App_LocalResources folder exists. The resources stored in App_GlobalResources will be page specific. Whereas the resources stored in App_LocalResources will be page specific. Resources are accessed programmatically as follow: myLabel.Text = Resources.Resource.Greeting ; Themes are simple text files where you can define the appearance of server controls that can be applied across site, or single page or a specific server control. You can also incorporate graphics and CSS
  • This page interacting with database as well as using Session state.
  • Asp.net architecture

    1. 1. Building Web Applications Ch. Vishwa Mohan Freelance Software Consultant & Corporate Trainer
    2. 2. Table of Contents <ul><li>Introducing .NET & ASP.NET </li></ul><ul><li>Creating and Programming Web Applications </li></ul><ul><li>Adding and Configuring Server Controls </li></ul><ul><li>Working with Master Pages & Themes </li></ul><ul><li>Accessing Data with ADO.NET </li></ul><ul><li>Working with XML </li></ul><ul><li>State Management </li></ul><ul><li>Navigation </li></ul><ul><li>Personalization and User Profiles </li></ul><ul><li>Securing and ASP.NET Web Application </li></ul><ul><li>Working with Web Parts </li></ul><ul><li>Creating Custom Web Controls </li></ul><ul><li>XML Web Services & WCF Essentials </li></ul><ul><li>Modules & Handlers </li></ul><ul><li>Globalization & Localization </li></ul><ul><li>Configuration & Deployment </li></ul>
    3. 3. Introducing .NET & ASP.NET
    4. 4. What is .NET Framework ? <ul><li>Microsoft .NET Framework is an environment for building, deploying, and running Web applications and Web Services. </li></ul><ul><li>Microsoft.NET Framework Advantages: </li></ul><ul><ul><li>Easier and quicker programming </li></ul></ul><ul><ul><li>Reduced amount of code </li></ul></ul><ul><ul><li>Declarative programming model </li></ul></ul><ul><ul><li>Richer server control hierarchy with events </li></ul></ul><ul><ul><li>Larger class library </li></ul></ul><ul><ul><li>Better support for development tools </li></ul></ul>
    5. 5. .NET Framework Platform & Tools Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services Windows® Forms Common Language Specification VB C++ C# J# …
    6. 6. <ul><li>ASP.NET is a web application framework used to build Web Applications and Web Services. </li></ul><ul><li>Part of Microsoft's .NET platform </li></ul><ul><li>ASP.NET is built on the CLR, allowing programmers to write ASP.NET code using any .NET language like C#, VB.NET. J# </li></ul><ul><li>ASP.NET also supports ADO.NET. </li></ul><ul><li>Runs on IIS </li></ul><ul><li>Successor to Microsoft's Active Server Pages (ASP) technology. </li></ul><ul><li>ASP.NET developed web pages have file extension “ .apsx ”. </li></ul><ul><ul><li>These files can contain HTML, XML and Scripts. </li></ul></ul><ul><li>With ASP.NET you can develop Web services also. These services have “ .asmx ” extension. </li></ul>What is ASP.NET ?
    7. 7. <ul><li>Controls: </li></ul><ul><ul><li>ASP.NET controls </li></ul></ul><ul><ul><ul><li>All Html Controls and other sophisticated input controls </li></ul></ul></ul><ul><ul><ul><li>Event Aware Controls All the asp objects on the web page is event aware. </li></ul></ul></ul><ul><ul><li>ASP.NET Components </li></ul></ul><ul><ul><ul><li>Components are heavily based on XML. Example the old AD Rotator now uses XML to store advertisement information and configuration. </li></ul></ul></ul><ul><li>Security </li></ul><ul><ul><li>Authentication </li></ul></ul><ul><ul><li>Authorization </li></ul></ul><ul><li>Scalability </li></ul><ul><ul><li>Application can scale over more than one server. Enhanced sever to server inter-communication. </li></ul></ul><ul><li>Improved Performance </li></ul><ul><ul><li>The first request for an ASP.NET page on the server will compile the ASP.NET code and keep a cached copy in memory. </li></ul></ul>ASP.NET Features
    8. 8. <ul><li>SQL Cache Invalidation. </li></ul><ul><li>Membership and Role Management. </li></ul><ul><li>Personalization services </li></ul><ul><li>Site Navigation </li></ul><ul><li>Master pages </li></ul><ul><li>Themes </li></ul><ul><li>Compilers for C#, Visual Basic, C++, and J#. </li></ul><ul><li>New Server Controls </li></ul><ul><li>New Localization technique </li></ul><ul><li>Support for Provider model </li></ul><ul><li>Support for 64-bit processors </li></ul>New Features of ASP.NET 2.0 <ul><li>Different types of available providers in ASP.NET 2.0: </li></ul><ul><ul><li>Membership Providers </li></ul></ul><ul><ul><li>Role Providers </li></ul></ul><ul><ul><li>Personalization Provider </li></ul></ul><ul><ul><li>SiteMap Provider </li></ul></ul><ul><ul><li>SessionState Provider </li></ul></ul><ul><ul><li>Web Event Providers </li></ul></ul><ul><ul><li>Configuration Provider </li></ul></ul><ul><ul><li>WebPart Provider </li></ul></ul>
    9. 9. <ul><li>ASP.NET applications that build on version 3.0 are benefited to use WPF, WCF, WWF and Cardspace. </li></ul>New Features of ASP.NET 3.0
    10. 10. <ul><li>AJAX </li></ul><ul><li>LINQ </li></ul><ul><li>New Compilers for C#, Visual Basic and C++ </li></ul><ul><li>Additional class in the Base class library </li></ul><ul><li>New Data Controls (ListView, DataPager) </li></ul>New Features of ASP.NET 3.5
    11. 11. <ul><li>Visual Studio is a completed set of development tool for building </li></ul><ul><ul><li>Desktop Applications </li></ul></ul><ul><ul><li>ASP.NET Web Applications </li></ul></ul><ul><ul><li>XML Web Services </li></ul></ul><ul><ul><li>Mobile Applications. </li></ul></ul><ul><ul><li>Class Libraries, .NET Components & Active X Controls </li></ul></ul><ul><li>Supporting Languages are: </li></ul><ul><ul><li>Visual C# </li></ul></ul><ul><ul><li>Visual Basic.NET </li></ul></ul><ul><ul><li>Visual C++ </li></ul></ul><ul><ul><li>More and more.., </li></ul></ul><ul><li>In addition to above languages you can also access functionality of .NET Framework, which provides access to key technologies that simplifies the development of ASP.NET applications and XML Web Services. </li></ul>Introducing Visual Studio
    12. 12. <ul><li>Visual Studio makes application development faster, easier, and more reliable. </li></ul><ul><li>Code-aware editors that include statement completion, syntax checking, and other IntelliSense features. </li></ul><ul><li>Visual designers for forms with drag and drop controls. </li></ul><ul><li>Integrated compilation and Debugging. </li></ul><ul><li>Source Control. </li></ul><ul><li>Database design tools </li></ul><ul><li>XML Editor support </li></ul><ul><li>SQL Server Integration </li></ul><ul><li>Server Explorer </li></ul><ul><li>Code change status notification. </li></ul><ul><li>Error Notification and Assistance </li></ul><ul><li>Supporting Code Snippets. </li></ul><ul><li>Allow you to pre-compile and deploy web site. </li></ul>Features of Visual Studio
    13. 13. Creating & Programming Web Applications
    14. 14. Creating Simple Web Site <ul><li>To Create a new Web Site from Visual Studio select </li></ul><ul><li>File  New  WebSite . </li></ul>
    15. 15. First look at Web Application <ul><li>Page Directive </li></ul><ul><li>ASP.NET Script </li></ul>
    16. 16. Code Page <ul><li>There is no link up between the ASP.Net page and the code here. </li></ul><ul><li>The is automatically achieved by the AutoEventWireUp attribute is set to true in the Page directive. </li></ul>
    17. 17. Adding new Web Page
    18. 18. <ul><li>ASP.NET pages are officially called Web Forms. </li></ul><ul><li>Using web forms we can create a web application using the same control-based interface as a Windows application. </li></ul><ul><li>Therefore instead of using html form tags, windows control can be used in the pages. </li></ul><ul><li>The ASP.NET ISAPI extension reads the “ aspx ” file and generates the corresponding objects, and fires a series of events. </li></ul><ul><li>All the controls used in Web form are embedded within a <form> element of Web page. </li></ul><ul><li>ASP.NET provides two paths for structuring the code for your ASP.NET pages: </li></ul><ul><ul><li>The single file Page Model </li></ul></ul><ul><ul><li>Code-behind Page Model ( default & recommended model ) </li></ul></ul><ul><li>Normally an ASP.NET page has two parts: </li></ul><ul><ul><li>Visual element tags like server control tags and static text. </li></ul></ul><ul><ul><li>Programming logic for the page, which includes event handlers and other code. </li></ul></ul>Web Pages <ul><li>Within ASP.NET web pages the code outside of </li></ul><ul><li><form runat=&quot;server&quot;> and <script runat=&quot;server&quot;> </li></ul><ul><li>elements is interpreted by the browser as client-side code . </li></ul><ul><ul><li><script runat=&quot;server &quot;> </li></ul></ul><ul><ul><li>//ASP.NET code goes here. Eg Button Click Handlers, etc., </li></ul></ul><ul><ul><li></script> </li></ul></ul><ul><li>In the above script, if you don’t put runat=“server” then it will become a client side script. </li></ul><ul><li>All the presentation elements goes inside <form> block. </li></ul><ul><li><form id=&quot;form1&quot; runat=&quot;server“ > </li></ul><ul><li>//ASP.NET code Eg: Controls on web page related stuff. <asp:Button ID=&quot;btnDisplay“ runat=&quot;server&quot; Text=&quot;Display&quot; /> </form> </li></ul>
    19. 19. <ul><li>Advantages of Single file page model : </li></ul><ul><ul><li>For a small simple page all code in one file is simpler to handle. </li></ul></ul><ul><ul><li>Slightly easier to deploy or transfer because you need to send only one file. </li></ul></ul><ul><ul><li>Because there is no dependency between files, a single-file page is easier to rename. </li></ul></ul><ul><li>Advantages of Code-behind page model : </li></ul><ul><ul><li>A clean separation of design and code </li></ul></ul><ul><ul><li>The design code is usually mark up code which is achieved through visual programming (drag drop). This code is generated automatically by visual studio. </li></ul></ul><ul><ul><li>This approach keeps the code that programmer writes is kept separate from the code that is automatically generated. </li></ul></ul><ul><ul><li>Page designers is not exposed to the code that programmers write. </li></ul></ul><ul><ul><li>Same code can be reused for multiple pages. </li></ul></ul>Differences between Page Models <ul><li>Both the visual elements and the programming logic is written in the same page. </li></ul><ul><li><%@ Page Language=&quot;C#&quot; %> </li></ul><ul><li><script runat=&quot;server&quot;> </li></ul><ul><li>void Button1_Click(Object sender, EventArgs e){ </li></ul><ul><li>Label1.Text = DateTime.Now.ToString(); } </li></ul><ul><li></script> </li></ul><ul><li><html> <head> <title> Single-FileModel </title> </head> </li></ul><ul><li><body> </li></ul><ul><li><form runat=&quot;server&quot;> </li></ul><ul><li><asp:Label id=&quot;Label1&quot; runat=&quot;server&quot; Text=&quot;Label“ /> </li></ul><ul><li><asp:Button id=&quot;Button1&quot; runat=&quot;server&quot; </li></ul><ul><li>onclick=&quot;Button1_Click&quot; Text=&quot;Button&quot;> </asp:Button> </li></ul><ul><li></form> </li></ul><ul><li></body> </li></ul><ul><li></html> </li></ul>
    20. 20. File Options Using Code-Behind File Options Created Files Web Form .aspx file .aspx.cs or .aspx.vb Master Page .master file .master.cs or .master.vb Web User Control .ascx file .ascx.cs or .ascx.vb Web Service .asmx file .cs or .vb file Trace Handlers trace.axd
    21. 21. Some Interested Files in ASP.NET File Usage AssemblyInfo.cs or vb A project information file contains metadata about the assemblies in a project, such as name, culture and version info. Web.config An XML based file that contains configuration data on-each unique URL resource used in the project Global.asax.cs or vb An optional file for handling application level events. Eg: Application_OnError, Session_OnStart, etc., Styles.css Cascade style sheet.
    22. 22. ASP.NET Application Folders <ul><li>App_Code Folder: In this folder the following files are kept. All these files are automatically available to your code. </li></ul><ul><ul><li>Meant to store classes ( .cs or .vb ) files, .wsdl file and typed dataset files. </li></ul></ul><ul><li>App_Data Folder: Different types of database and XML files stored. </li></ul><ul><ul><li>MS Access ( .mdb ) files, MS-SQL ( .mdf ) files, XML files. </li></ul></ul><ul><ul><li>Files stored in this folder can’t be pulled up into the browser. </li></ul></ul><ul><li>App_Themes Folder: </li></ul><ul><ul><li>Skin files, CSS files, Images </li></ul></ul><ul><li>App_GlobalResources Folder: In this folder .resx files stored. </li></ul><ul><li>App_LocalResources Folder: Places .resx files specified to page. </li></ul><ul><li>App_WebReferences: Place web services references in this folder. </li></ul><ul><li>Global.asax file: This file has events can be used to initialize the objects in the application level and session level. </li></ul>
    23. 23. ASP.NET Execution Model
    24. 24. ASP.NET Execution Model
    25. 25. Execution Model with Session State
    26. 26. Thank You !

    ×