Presentation is loading. Please wait.

Presentation is loading. Please wait.

Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,

Similar presentations


Presentation on theme: "Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,"— Presentation transcript:

1 Text INTRODUCTION TO ASP.NET

2 InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored, extensible architecture Superior debugging and tracing support Compiled, not interpreted Rich caching support Web farm scalable session state Automatically detects and recovers from errors ASP.NET?

3 InterComm Campaign Guidelines CONFIDENTIAL Request and Respond

4 InterComm Campaign Guidelines CONFIDENTIAL General things to know 3 Client Side Scripting Server Side Scripting HTML JavaScript CSS JQuery Ajax XML

5 InterComm Campaign Guidelines CONFIDENTIAL - 4 - Web forms in ASP.NET Separate Code & Design Rich Web Forms Drag & Drop Design Like WinForms

6 InterComm Campaign Guidelines CONFIDENTIAL - 5 - Understand the Web form Page Directive Server side code Form Normal HTML Structure Server Controls

7 InterComm Campaign Guidelines CONFIDENTIAL - 6 - Page Life Cycle PreInitInit Init Complete PreLoadLoad Control events Load Complete Pre Render Save State Complete RenderUnload

8 InterComm Campaign Guidelines CONFIDENTIAL - 7 - ASP.NET States Session State  allows the state of objects (serializable) to be stored for a single session (lifetime of the user’s browser or specific timeout) Application State  allows the state of objects (serializable) to be stored for the application across different sessions. View State  state stored in a hidden field on the page  transported to the client and back to the server,  Is not stored on the server

9 Text Thank You

10 Text EXCEPTION HANDLING

11 InterComm Campaign Guidelines CONFIDENTIAL - 10 - What is an Exception Error ? An exception is a problem that arises during the execution of a program. An ASP.NET exception is a response to an exceptional situation that arises while a program is running, such as an attempt to divide by zero. Exception provides a way to transfer control from one part of program to another.

12 InterComm Campaign Guidelines CONFIDENTIAL - 11 - Exception Handling Exception Handling is based upon 4 keywords : try : A try block identifies a block of code for which particular exceptions will be activated. It's followed by one or more catch blocks. catch : A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The catch keyword indicates the catching of an exception. finally : The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown. throw : A program throws an exception when a problem shows up. This is done using a throw keyword.

13 InterComm Campaign Guidelines CONFIDENTIAL - 12 - Syntax

14 InterComm Campaign Guidelines CONFIDENTIAL - 13 - What is an Exception Error ? C# exceptions are represented by classes. The exception classes in C# are mainly directly or indirectly derived from the System.Exception class. Some of the exception classes derived from the System. Exception class are the System.ApplicationException and System.SystemException classes.

15 InterComm Campaign Guidelines CONFIDENTIAL - 14 - Exception Types Examples

16 Text Thank You

17 Text VALIDATION IN ASP.NET

18 InterComm Campaign Guidelines CONFIDENTIAL - 17 - Validation Controls Asp. Net Provides Some validation controls. These Controls are similar to other common controls and can be used in the same way. A Validation server control is used to validate the data of an input control. If the data does not pass validation, it will display an error message to the user.

19 InterComm Campaign Guidelines CONFIDENTIAL - 18 - Validation Server Controls Required Field Validator Compare Validator Range Validator Regular Expression Validator Custom Validator Validation Summary

20 InterComm Campaign Guidelines CONFIDENTIAL - 19 - Required Field Validator Used to make an input control a required field. Validation fails if the input value does not change from its initial value. By default, the initial value is an empty string (""). Leading and trailing spaces of the input value are removed before validation. The InitialValue property does not set the default value for the input control. It indicates the value that you do not want the user to enter in the input control.

21 InterComm Campaign Guidelines CONFIDENTIAL - 20 - Compare Validator Used to compare the value of one input control to the value of another input control or to a fixed value. If the input control is empty, the validation will succeed. We can use the Required Field Validator control to make the field required.

22 InterComm Campaign Guidelines CONFIDENTIAL - 21 - Range Validator Used to check that the user enters an input value that falls between two values. Possible to check ranges within numbers, dates, and characters. Validation will not fail if the input control is empty. Use the Required Field Validator control to make the field required. Validation will not fail if the input value cannot be converted to the data type specified. Use the Compare Validator control for the same.

23 InterComm Campaign Guidelines CONFIDENTIAL - 22 - Regular Expression Validator Used to ensure that an input value matches a specified pattern. Both server and client-side validation are performed unless the browser does not support client-side validation or the EnableClientScript property is set to false. Validation will not fail if the input control is empty. Use the Required Field Validator control to make the field required.

24 InterComm Campaign Guidelines CONFIDENTIAL - 23 - Custom Validator The Custom Validator control allows you to write a method to handle the validation of the value entered. This control helps in implementing user defined validations. To Do this you have to write the user defined function in the head section in tag.

25 InterComm Campaign Guidelines CONFIDENTIAL - 24 - Validation Summary Used to display a summary of all validation errors occurred in a Web page. Error message displayed in this control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message is displayed for that validation control.

26 Text Thank You

27 Text MVC

28 InterComm Campaign Guidelines CONFIDENTIAL - 27 - What is MVC? Model Controller View

29 InterComm Campaign Guidelines CONFIDENTIAL - 28 - Separations of Concerns Each component has one responsibility SRP : Single Responsibility Principle DRY : Don’t Repeat Yourself More easily testable Helps with concurrent development

30 InterComm Campaign Guidelines CONFIDENTIAL - 29 - MVC Flow Request ControllerController Step 1 Incoming request directed to Controller

31 InterComm Campaign Guidelines CONFIDENTIAL - 30 - MVC Flow Request ControllerController Model Step 2 Controller processes request and forms a data Model

32 InterComm Campaign Guidelines CONFIDENTIAL - 31 - MVC Flow Request ControllerController ViewView Step 3 Model is passed to View

33 InterComm Campaign Guidelines CONFIDENTIAL - 32 - MVC Flow Request ControllerController ResponseResponse ViewView Step 5 Response is rendered

34 InterComm Campaign Guidelines CONFIDENTIAL - 33 - Detailed Flow of MVC Request HTTP Routing Route Route Handler Http Handler Controller View Engine View Response

35 Text Thank You


Download ppt "Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,"

Similar presentations


Ads by Google