.Net<br />Table of contents<br />Introduction to VS 2005 <br />Application and Page Frameworks <br />GUI Controls <br />Va...
Introduction to VS 2005<br />Visual Studio 2005 is an IDE that is used to create ASPX pages (Web application)<br />Creatio...
We can see these windows when we open the Visual Studio<br />Property Window – Shows the properties of a control(Page or b...
IIS – Internet Information Services<br />IIS is a web server that comes along with .Net<br />We can configure IIS using “i...
ASP .Net<br />Used to create web applications and web services that run under IIS<br />ASP.NET is a collection of .NET cla...
ASP .Net Framework<br />ASP.NET is a managed server-side framework <br />For building applications based on HTTP, HTML, XM...
Life cycle of a web page<br />Page_Init <br />This is called when page is initialized. We can declare some variables which...
Life cycle of a web application<br />The Life of web application begins when a user requests for a page through the browse...
Client Performs tasks like button click<br />The page’s data is sent back to server<br />When server receives this page  i...
ASP .Net Advantages<br />Executable portion of a web application are  compiled<br />Enriched tool support<br />Application...
Application and Page Framework<br />
ASP .Net Applications<br /><ul><li>Each application is based on IIS virtual directory
Each application is contained within a physical directory
Each application runs in its own isolated AppDomain
Namespace must for this application is System.Web</li></li></ul><li>ASP .Net Pages<br />Code and Design are separated<br /...
ASP .Net Pages (Contd..)<br />ASPX Page has<br />&lt;asp:Button id=“LookUp“ OnClick=btnSubmit_Click“ /&gt;<br />C# file wi...
Files in a Web application Project<br />AssemblyInfo.cs<br /> All the information about assembly including version, compan...
GUI Controls<br />
Server Control<br />
Web Controls<br />ListControl<br />ListBox<br />CheckBoxList<br />Button<br />Table<br />WebControl<br />System.Web.UI.Con...
Postback event<br />These events cause the web page to be sent back to the server for immediate processing<br />When page ...
Validation Controls<br />ASP .Net provides 5 validation controls that are used to check the validity of data entered by th...
Required Field Validator<br />To check whether a control contains data<br />Properties:<br />ControlToValidate<br />ErrorM...
Regular Expression Validator<br />To check whether the entered data matches a specific format<br />Properties<br />Control...
Compare Validator<br />To compare values entered in two controls<br />Properties:<br />ControlToCompare<br />ControlToVali...
Range Validator<br />To compare whether the entered value is between two specified values<br />Properties:<br />ControlToV...
To Check the validity of an entered item using a client-side script or a server-side code, or both<br />Properties:<br />C...
To Display validation errors in a central location or display a general validation error description<br />Properties:<br /...
We can create our own controls in addition to HTML and Web controls<br />User controls offer you an easy way to partition ...
To use a user control, just drag the ascx file from the solution explorer and drop it on the design area of the aspx page<...
The Calendar Web server control displays a traditional one-month calendar on your Web Forms pages<br />Few properties:<br ...
DateTime is a static class. Members can be accessed via DateTime.Now and so on.<br />The DateTime value type represents da...
Full-featured list output<br />Default is to show all columns<br />Can specify a subset of columns to display<br />Provide...
Provides simple output of list of items<br />Templates provide the visual form<br />It iterates over the bound data<br />D...
Upcoming SlideShare
Loading in …5
×

ASP.Net Presentation Part1

1,876 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,876
On SlideShare
0
From Embeds
0
Number of Embeds
223
Actions
Shares
0
Downloads
131
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

ASP.Net Presentation Part1

  1. 1. .Net<br />Table of contents<br />Introduction to VS 2005 <br />Application and Page Frameworks <br />GUI Controls <br />Validation Server Controls <br />Working with Master Pages <br />Themes & Skins <br />Collections & Lists <br />Data Binding <br />Data Management with ADO.Net <br />Working with XML <br />Site Navigation <br />Security <br />State Management <br />Caching <br />Debugging & Error Handling <br />File I/O & Streams <br />Configurations <br />
  2. 2. Introduction to VS 2005<br />Visual Studio 2005 is an IDE that is used to create ASPX pages (Web application)<br />Creation of web application also creates a set of files.<br />Web application exists only in the location specified by IIS virtual folder.<br />In a system, the web root folder is //localhost This is the virtual folder<br />The physical path for this virtual folder is netpubwwwroot<br />
  3. 3. We can see these windows when we open the Visual Studio<br />Property Window – Shows the properties of a control(Page or button or textbox)<br />Solution Explorer – Shows the files that a opened project has<br />Output Window – Shows the result of a compilation or execution of a program<br />Error List – Shows the compilation errors etc.<br />What can you find in a VS<br />
  4. 4. IIS – Internet Information Services<br />IIS is a web server that comes along with .Net<br />We can configure IIS using “inetmgr”<br />In the Start Menu, choose Run and type inetmgr. We will get a window that lists the websites present in the system.<br />For creating a virtual directory, right click on the default website and select New -&gt; Virtual Directory. <br />Give the alias name <br />Give the physical path<br />Give the access permissions and click finish.<br />
  5. 5. ASP .Net<br />Used to create web applications and web services that run under IIS<br />ASP.NET is a collection of .NET classes that collaborate to process an HTTP request and generate an HTTP response<br />Helps us in creating Dynamic Web pages<br />Dynamic web pages – Pages will be generated at the server based on the user’s request and then given back to the client (user)<br />
  6. 6. ASP .Net Framework<br />ASP.NET is a managed server-side framework <br />For building applications based on HTTP, HTML, XML and SOAP<br />ASP.NET relies on IIS for an HTTP entry point<br />ASP.NET supports building HTML-based Web Applications<br />Based on ASP.NET pages, Web forms and server-side controls<br />ASP.NET supports building Web Services<br />Based on Web service classes and WebMethods<br />
  7. 7. Life cycle of a web page<br />Page_Init <br />This is called when page is initialized. We can declare some variables which need to be initialized before page is loaded<br />Page_Load<br />The server controls are loaded in the page .This event is called every time when page is loaded<br />Control_Event<br />This event is fired when control like button are clicked or changed<br />Page_Unload<br />This event occurs when a page is Unloaded from memory<br />Page_Dispose<br />This event occurs when a page is released from memory<br />
  8. 8. Life cycle of a web application<br />The Life of web application begins when a user requests for a page through the browser (client)<br />When IIS receives request from client it calls ASP. NET worker process<br />The ASP.NET worker process loads the assembly <br />The executable creates an instance of web form<br />Generates the HTML page to respond to the request<br />Posts the response to browser and then it destroys the instance of the web form<br />Then browser receives the generated HTML<br />
  9. 9. Client Performs tasks like button click<br />The page’s data is sent back to server<br />When server receives this page it creates new instance of web form <br />Processes the event occurred<br />Then again send back HTML and destroys the page<br />When user stops the web application for a period of time session ends<br />Life cycle of a web application (Contd..)<br />
  10. 10. ASP .Net Advantages<br />Executable portion of a web application are compiled<br />Enriched tool support<br />Applications are based on CLR<br />Common Language Runtime<br />On the fly updates deployed without restarting server<br />Better session management<br />Integration with ADO.NET<br />Built in features for caching<br />Create XML Web services <br />Browser-independent<br />Language-independent<br />
  11. 11. Application and Page Framework<br />
  12. 12. ASP .Net Applications<br /><ul><li>Each application is based on IIS virtual directory
  13. 13. Each application is contained within a physical directory
  14. 14. Each application runs in its own isolated AppDomain
  15. 15. Namespace must for this application is System.Web</li></li></ul><li>ASP .Net Pages<br />Code and Design are separated<br />Design file – ASPX file<br />Contains ASPX or HTML tags<br />Code file – called as code behind file<br />Has the programming logic<br />Programming language can be <br />C#<br />VB .Net<br />
  16. 16. ASP .Net Pages (Contd..)<br />ASPX Page has<br />&lt;asp:Button id=“LookUp“ OnClick=btnSubmit_Click“ /&gt;<br />C# file will have<br />btnSubmit_Click() { ... }<br />The code behind page is inherited from System.Web.UI.Page class<br />The .aspx file containing the user interface is inherited from code behind class<br />
  17. 17. Files in a Web application Project<br />AssemblyInfo.cs<br /> All the information about assembly including version, company name etc<br />Default.aspx<br />The visual description of a Web form. <br />Default.aspx.cs<br />The code behind that responds to events on the Web form <br />Default.aspx.resx<br />XML resources used by web form<br />Global.asax <br />The global events that occur in web applications<br />Web.config<br />Configuration contents like authentication mode, error files etc.<br />
  18. 18. GUI Controls<br />
  19. 19. Server Control<br />
  20. 20. Web Controls<br />ListControl<br />ListBox<br />CheckBoxList<br />Button<br />Table<br />WebControl<br />System.Web.UI.Control<br />System.Object<br />TextBox<br />...<br />...<br />
  21. 21. Postback event<br />These events cause the web page to be sent back to the server for immediate processing<br />When page is posted back ,the Page_Init, Page _Load events are handled <br />The page is submitted back and renders a new version of itself back to the user<br />
  22. 22. Validation Controls<br />ASP .Net provides 5 validation controls that are used to check the validity of data entered by the user in the server controls on the web page.<br />Client side validation is also possible through a Jscript library WebUIValidation.js<br />Required field validator<br />Regular expression validator<br />Compare validator<br />Range validator<br />Custom validator<br />Validation summary<br />
  23. 23. Required Field Validator<br />To check whether a control contains data<br />Properties:<br />ControlToValidate<br />ErrorMessage<br />Text<br />Method:<br />Validate<br />
  24. 24. Regular Expression Validator<br />To check whether the entered data matches a specific format<br />Properties<br />ControlToValidate<br />ValidationExpression<br />ErrorMessage<br />Method<br />Validate<br />
  25. 25. Compare Validator<br />To compare values entered in two controls<br />Properties:<br />ControlToCompare<br />ControlToValidate<br />ErrorMessage<br />ValueToCompare<br />Method:<br />Validate<br />
  26. 26. Range Validator<br />To compare whether the entered value is between two specified values<br />Properties:<br />ControlToValidate<br />ErrorMessage<br />Type<br />MaximumValue<br />MinimumValue<br />Method:<br />Validate<br />
  27. 27. To Check the validity of an entered item using a client-side script or a server-side code, or both<br />Properties:<br />ControlToValidate<br />ErrorMessage<br />Events:<br />ServerValidate<br />Method:<br />OnServerValidate<br />Validate<br />Custom Validator<br />
  28. 28. To Display validation errors in a central location or display a general validation error description<br />Properties:<br />HeadText<br />ShowMessageBox<br />ShowSummary<br />Validation Summary<br />
  29. 29. We can create our own controls in addition to HTML and Web controls<br />User controls offer you an easy way to partition and reuse common user interface (UI) functionality across your ASP.NET Web applications<br />User controls are not compiled until run time<br />You can simply drag and drop them on the page and start using them<br />To create a user control:<br />Add a new item ( select user control as a template) and give it a name – Heading.ascx<br />The following description can be seen in HTML view<br /> &lt;%@Control Language=&quot;c#&quot; AutoEventWireup=&quot;false&quot; Codebehind=&quot;Heading.ascx.cs“&gt;<br />User Controls<br />
  30. 30. To use a user control, just drag the ascx file from the solution explorer and drop it on the design area of the aspx page<br />Or give like this in the html view of the aspx page<br />In the head portion<br />&lt;%@Register TagPrefix=&quot;uc1&quot; TagName=&quot;Heading&quot; src=&quot;Heading.ascx&quot;%&gt;<br />In the body portion<br />&lt;uc1 id=“user1”/&gt;<br />Using a User Control<br />
  31. 31. The Calendar Web server control displays a traditional one-month calendar on your Web Forms pages<br />Few properties:<br />SelectedDate<br />SelectedDates<br />BackColor<br />Few methods:<br />AddDays()<br />AddMonths()<br />AddYears()<br />GetMonth()<br />GetYear()<br />GetDayOfWeek()<br />IsLeapYear()<br />Calendar Control<br />
  32. 32. DateTime is a static class. Members can be accessed via DateTime.Now and so on.<br />The DateTime value type represents dates and times with values ranging from 12:00:00 midnight, January 1, 0001 Common Era to 11:59:59 P.M., December 31, 9999 C.E.<br />Few properties:<br />Today<br />Now<br />Date<br />Few Methods:<br />AddDays()<br />AddMonths()<br />Compare()<br />ToLongDateString()<br />ToShortDateString()<br />DateTime<br />
  33. 33. Full-featured list output<br />Default is to show all columns<br />Can specify a subset of columns to display<br />Provides templates<br />Standard <br />Custom<br />Provides paging<br />Provides data updates<br />DataGrid Control<br />
  34. 34. Provides simple output of list of items<br />Templates provide the visual form<br />It iterates over the bound data<br />Display format of data is managed<br />Does not support paging<br />Provides templates for separators<br />Does not provide data updates<br />Repeater Control<br />
  35. 35. HeaderTemplate<br />Rendered before all data bound rows<br />ItemTemplate<br />Rendered for each row in the data source<br />AlternatingItemTemplate<br />Rendered for every other row <br />SeparatorTemplate<br />Rendered between each row<br />FooterTemplate<br />Rendered after all data bound rows<br />Standard templates for Repeater controls<br />
  36. 36. To bind embedded controls to the data source of the container control<br />DataBinder.Eval() method is used<br />Syntax<br />&lt;%#DataBinder.Eval(Container.DataItem,“DataFieldname&quot;)%&gt;<br />Container represents the container for data items <br />DataFieldname represents the name of data item field<br />Binding data<br />

×