Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser.

Similar presentations


Presentation on theme: "Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser."— Presentation transcript:

1 Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser is an example of a web application.

2 Static and Dynamic Page
The content of a web application that consists of only HTML pages is static. It does not respond dynamically to the actions performed buy users. To respond dynamically to user request we create Dynamic pages.

3 Types of Scripting Client Side Scripting Server Side Scripting

4 Client Side Scripting Enables you to develop Web pages that can dynamically respond to user input without having to interact with a Web server.

5 Advantages of Client Side Scripting
Reduce network traffic Speed up the response time

6 CSS Language VB Script Java Script

7 Server Side Scripting Provides dynamic content to users based on the information stored in a remote location. It executed on a Web Server.

8 SSS Language Active Server Pages (ASP) Java Server Pages (JSP)

9 ASP. Net .Net version of ASP introduced by Microsoft.
To help developers create globally distributed software with Internet functionality. Enable you to access information from data source. Enables you to separate HTML design from the data retrieval mechanism.

10 Elements in ASP. Net Web Forms Configuration Files
XML Web Service Files State Management Runtime Services

11 Web Forms Web forms enable you to include user interface such as TextBox,ListBox and application logic of web applications.

12 Configuration File Enable you to store the configuration settings of an ASP. Net application.

13 Development Environment
.Net Framework ISS (Internet Information Services)

14 IIS IIS server enables you to access the ASP. Net web application. It's work as a Web server on the network. Web server for windows platform)

15 Working of an ASP. Net application
Web browser send a request by URL IIS receive and retrieves the appropriate file from the memory. Forward it to ASP. Net script engine. Script Engine to ISS ISS to client

16 Features of ASP. Net Compiled Code Enriched Tool Support(WYSIWYG)
Power and Flexibility Simplicity Manageability (xml) Scalability (further enhancement) Security

17 Programming Models in ASP. Net
Web Forms Web Services

18 Check your self What is a Web Application?
What’s the difference between Static and Dynamic pages? What is Scripting? How many types of Scripting Languages? Describe about Client Side Scripting? Describe about server Side Scripting? What’s are the advantage of client side scripting?

19 Write down some Client Side Scripting Languages?
Write down some Server Side Scripting Languages? What’s are the advantages of ASP. Net? What is ISS?

20 Web Services Enable you to access certain functionality at the server side. These services enable the exchange of data in a client to server or a server to server environment over the web.

21 Controls in ASP. Net System. Object System.Web.UI
System.Web.UI.Control System.Web.UI.WebControls System.Web.UI.HTMLControls

22 Types of Controls ASP. Net HTML controls ASP. Net Web controls
Validation controls User controls

23 HTML controls Replicas of the standard HTML tag
HTML tag are converted into HTML controls by using attributes such as ID etc. <Input Type = Text Runat =“server” ID = “textbox1” value = “welcome”>

24 Web Controls Basic Web controls List controls Rich Web controls
textbox,label,button,hyperlink,radiobutton etc. List controls Listbox,dropdownlist,checkboxlist etc. Rich Web controls Calendar etc. Data controls Datagrid,datalist,repeater

25 Validation controls Used to validate the user input.
Attached to input controls to check the values that a user enters for input controls.

26 Types of Validation Controls
Compare Validator Custum Validator Range Validator Regular Validator RequiredField Validator Validation Summary

27 User Controls User Controls are ASP. Net pages that are converted into controls. Extension is .ascx

28 File used in an ASP.Net Application
AssemblyInfo.cs :- This file contains a set of attributes that contain general information about the assembly such as the name, description and version of the assembly.

29 Global.asax:- Each web application will have one Global.asax file attached to it. It contains scripts that define the start and end events of the application.

30 Web.config:- This is the configuration file for your application. It is an XML file that contains configuration data.

31 Code Behind Feature of ASP. Net
The code behind future of ASP. Net enables you to divide an ASP. Net page in to two files. One file contains the presentation content and other file which is called the code behind file, contains all application logic. Presentation file -.aspx Code behind file - .cs

32 Automatically Generated Code
Page language =“C#” Codebehind=“WebForm1.aspx.cs” AutoEventWireup=“false” Inherits=“WebApplication1.WebForm1” Language : Any .NET Framework supported language

33 AutoEventWireup Whether the page Framework calls page events and methods automatically for an ASP. Net page Default value is set to false. False value indicate that you must explicitly write code to bind page events.

34 Codebehind and Inherits
The code behind file for a page. The class in the code behind file that a page inherits. This class can be any class derived from the Page class.

35 Code Inline The practice of writing application logic in the presentation file is known as code inline.

36 Page Events Init Load Control Unload

37 Init and Load event You can write the page initialization code in the Init or Load event of the Web Page. Page_Init is the event handler for the Init event and Page_Load is the event handler for the Load event of the page.

38 Difference between Init and Load
There is a difference between the Init and Load event. When the Init event is fired all controls are loaded with their default values. On the other hand when the Load event is fired the controls are loaded in the memory with values that are set during the round trip.

39 Round Trip A round trip is a sequence of events that a web page follows to complete the journey from a web browser to a web server.

40 Control Event After the Init and Load event the page is served to user. When the user interact with the page to generate a control event such as click on a button the page is posted back to the server and the code in the control’s event handler is executed. After processing the page is re crated and the page follow the same Init and Load events.

41 IsPostBack Property of the Web Page
You can avoid the firing of Init and Load event by using the IsPostBack property of a web page. It’s allow you to check whether the page is being requested for the first time.

42 Unload event Finally when a user close the page or exits from the browser the page is unloaded from the memory and the Unload event is fired.

43 Code Declaration Blocks
We can add application logic or code in two different ways. One is in code behind file and another is in html code. Mostly we prefer Code behind future. If we write code in html then it’s known as Code Declaration Blocks. <script language=“lan.name” runat=“server”> </script>

44 ASP. Net Built in Objects
ASP. Net has a number of built in objects that run on a Web server. Built in Objects in ASP. Net are – Application Request Response Server Session

45 Application Object The Application object is used to store and retrieve information that can be shared among all the users of an application. Provides access to application-wide methods and events for all sessions. Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Application state applies to all users and all sessions. Therefore, application state is a useful place to store small amounts of often-used data that does not change from one user to another.

46 Request objects Request:-
The request object is used to access the information sent in a request from a browser to the server.

47 Response object Response :-
The response object is used to send information to the browser.

48 Server object Server :-
The server object is used to access various utility functions on the server.

49 Session object The session object is used to store and retrieve information about particular user sessions. It is use to persist information throughout the user session. ASP. Net session state enables you to store and retrieve values for a user as the user navigates the different ASP. Net pages that make up a Web application. ASP. Net session state is enabled by default for all ASP. Net applications. ASP. Net session-state variables are easily set and retrieved using the Session property, which stores session variable.

50 RequiredField Validator
You can specify that a user must provide information in a specific control on an ASP.NET Web page by adding a RequiredFieldValidator control to the page and linking it to the required control. For example, you can specify that users must fill in a Name text box before they can submit a registration form.

51 Properties for RequiredField Validator
ControlToValidate – Used to specify the ID of the control that is to be validated. ErrorMessege – Message that we want to show at the time of error Text – For showing the text when error occur.

52 Example –RequiredField Validator

53 RegularExpressionValidator
The RegularExpressionValidator control performs its validation by comparing the data value to the regular expression pattern. If the data value in the control does not match the regular expression the RegularExpressionValidator control displays error.

54 Properties for RegularExpression Validator
ControlToValidate ErrorMessege ValidationExpression – Validation condition for validate the control. By default different types of validation statements are present in it.

55 Validation Expression
[] – a set of characters Used to match any one of the characters with in [].we can specify a range of characters by listing the starting and ending characters separated by a dash like [a-z]. Exa – “A[5-9]” The above expression can be used to validate a product id that start with the letter A followed by a digit with in range of 5 to 9.

56 Validation Expression
{n} –Tagged expression Used to match an expression exactly n times. Exa – “A[0-5]{6}” The above expression can be used to validate a product id that starts with the letter A followed by six digits ranging from 0 to 5.

57 Validation Expression
\w – Word characters Used to match any letter, numeric and underscore character. “\w{8,20}” The above expression can be used to validate a password with the minimum length of 8 characters and a maximum length of 20 characters.

58 Validation Expression
. – any character Used to match any one character “ ” The above expression can be used to check for date formats such as 17/09/1983, etc.

59 Validation Expression
/s – any nonwhite space character used to match any character except spaces, tabs and line breaks. The above expression can be used to check whether a valid web address has been entered such as etc.

60 Validation Expression
+ - one or more character Used to match at least one occurrence of the preceding expression The above expression can be used to validate an id such as

61 Validation Expression
? - any single character Used to match any single preceding character in an expression “students?” The above expression can be used to specify that the letter s is optional. Therefore you can use the above expression to check whether a user has entered any word other than student or students.

62 Validation Expression
\d – any digit character Used to match any digit in the range 0 to 9. “\d{6}” The above expression can be used to check for a pin code that has exactly 6 digits.

63 Compare Validator use the CompareValidator control to compare the data value entered by the user to a value in another control.

64 Properties for Compare Validator
ControlToCompare – Used to specify the ID of the control that will used to compare values. ControlToValidate – Used to specify the ID of the control is to be validator. ErrorMessege ValueToCompare

65 Range Validator This control is used to check whether the value of a particular control with in the minimum number and the maximum number. The minimum and maximum number values can be dates, number etc.

66 Properties of Range Validator
Control to validate Error massage Maximum value Minimum value

67 Validation Summary This control is used to summarize all errors and display the error list in a user specified location.

68 Properties of Validation Summary
HeadText – used to set the text that will be displayed at the top of the summary. ShowMessegeBox – Used to display the error message in a pop up message box when the value of this property is True. ShowSummary – Used to enable or disable the summary of error messages.

69 Data Binding Data Binding helps you develop such applications where controls can be bound to the values stored in a data source.

70 Syntax for data binding
<%# expression %> Consider the following line of code added in the HTML view of a web form – <asp:TextBox id = “Name” Text = “<%# source %>” runat = “server”></asp:TextBox>

71 Data Binding Expression
The portion of the code delimited with the characters <%# and %> is called Data Binding Expression. We can only include data binding syntax expression with in it.

72 DataBind() Method Any server control will not display data source values until we use the DataBind() method. The DataBind() method evaluates the data binding expression and displays the evaluated expression in the server control. We can write the following line of code in the Load event of the Web Form to evaluate all the binding expressions in the page: Page.DataBind(); or DataBind(); If we have just a single control for binding then we can use the DataBind() with that perticuler control.

73 Type of Data Binding Single Value Data Binding Multi Record Binding

74 Single Value Data Binding
Single value data binding involves binding controls which can display a single data value at a time. Exa. – label control, textbox control

75 Multi Record Data Binding

76

77

78


Download ppt "Web Application Web Application are programs that can be executed either on a Web server or in a Web browser. An Online store accessed through a browser."

Similar presentations


Ads by Google