Download presentation
Presentation is loading. Please wait.
1
Asp.net
2
BASE CLASS LIBRARY .NET Framework Class Library is the collection of classes, namespaces, interfaces and value types that are used for .NET applications.
3
CLR .NET CLR is a run-time environment that manages and executes the code written in any .NET programming language. It converts code into native code which further can be executed by the CPU.
4
STRUCTURE
5
It converts program into native code. Handles Exceptions
FUNCTIONS: It converts program into native code. Handles Exceptions Provides type safety Memory management Provides security Improved performance Language independent Platform independent Garbage collection
6
CTS The Common Type System (CTS) is a standard for defining and using data types in the .NETframework. CTS defines a collection of data types, which are used and managed by the run time to facilitate cross-language integration. In contrast to low-level languages like C and C++ where classes/structs have to be used for defining types often used (like date or time), CTS provides a rich hierarchy of such types without the need for any inclusion of header files or libraries in the code.
7
CTS is a specification created by Microsoft and included in the European Computer Manufacturer‘s Association standard. CTS is designed as a singly rooted object hierarchy with System.Object as the base type from which all other types are derived. CTS supports two different kinds of types: Value Types: Contain the values that need to be stored directly on the stack or allocated inline in a structure. Reference Types: Store a reference to the value‘s memory address and are allocated on the heap.
8
NAMESPACES A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces Description System It includes all common datatypes, string values, arrays and methods for data conversion. System.IO, System.DirectoryServices, System.IO.IsolatedStorage These are used to access, read and write files.
9
Namespaces Description System.Net, System.Net.Sockets These are used to communicate over the Internet when creating peer-to-peer applications. System.Windows.Forms, System.Windows.Forms.Design These namespaces are used to create Windows-based applications using Windows user interface components. System.Diagnostics It is used to debug and trace the execution of an application.
10
INTERMEDIATE CODE Intermediate language (IL) is an object-oriented programming language designed to be used by compilers for the .NET Framework before static or dynamic compilation to machine code. The IL is used by the .NET Framework to generate machine-independent code as the output of compilation of the source code written in any .NET programming language. This term is also known as Microsoft intermediate language (MSIL) or common intermediate language (CIL).
11
With the help of a suitable just-in-time (JIT) compiler, IL code can be executed on any computer architecture supported by the JIT compiler. JIT compilation provides better performance, preserves memory, and saves time during application initialization. The two tools associated with IL code are the MSIL Assembler (Ilasm.exe) and the MSIL Disassembler (Ildasm.exe). The former(MSIL Assembler) generates a portable executable file from IL code and permits viewing the IL code in human-readable format.
12
The latter(MSIL Disassembler) converts a portable executable file back to a text file, for viewing and modification. Both are automatically installed as part of Visual Studio.
13
VALIDATION CONTROLS ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or contradictory data don't get stored. ASP.NET provides the following validation controls: RequiredFieldValidator RangeValidator CompareValidator RegularExpressionValidator CustomValidator ValidationSummary
14
REQUIRED FIELD VALIDATOR
The RequiredFieldValidator control ensures that the required field is not empty. It is generally tied to a text box to force input into the text box. SYNTAX: <asp:RequiredFieldValidator ID="rfvcandidate" runat="server" ControlToValidate ="ddlcandidate" ErrorMessage="Please choose a candidate" InitialValue="Please choose a candidate"> </asp:RequiredFieldValidator>
15
RangeValidator Control
The RangeValidator control verifies that the input value falls within a predetermined range. It has three specific properties: Properties Description Type It defines the type of the data. The available values are: Currency, Date, Double, Integer, and String. MinimumValue It specifies the minimum value of the range. MaximumValue It specifies the maximum value of the range.
16
CompareValidator Control
The CompareValidator control compares a value in one control with a fixed value or a value in another control. It has the following specific properties: Properties Description Type It specifies the data type. ControlToComp are It specifies the value of the input control to compare with. ValueToCompar e It specifies the constant value to compare with. Operator It specifies the comparison operator, the available values are: Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, and DataTypeCheck.
17
RegularExpressionValidator
The RegularExpressionValidator allows validating the input text by matching against a pattern of a regular expression. The regular expression is set in the ValidationExpression property. The following table summarizes the commonly used syntax constructs for regular expressions:
18
Character Escapes Description \b Matches a backspace. \t Matches a tab. \r Matches a carriage return. \v Matches a vertical tab. \f Matches a form feed. \n Matches a new line. \ Escape character.
19
Apart from single character match, a class of characters could be specified that can be matched, called the metacharacters. Metacharacters Description . Matches any character except \n. [abcd] Matches any character in the set. [^abcd] Excludes any character in the set. [2-7a-mA-M] Matches any character specified in the range. \w Matches any alphanumeric character and underscore. \W Matches any non-word character. \s Matches whitespace characters like, space, tab, new line etc. \S Matches any non-whitespace character. \d Matches any decimal character. \D Matches any non-decimal character.
20
Quantifiers could be added to specify number of times a character could appear.
Description * Zero or more matches. + One or more matches. ? Zero or one matches. {N} N matches. {N,} N or more matches. {N,M} Between N and M matches.
21
Custom validator The CustomValidator control allows writing application specific custom validation routines for both the client side and the server side validation. The client side validation routine should be written in a scripting language, such as JavaScript or VBScript, which the browser can understand. The server side validation routine must be called from the control's ServerValidate event handler. The server side validation routine should be written in any .Net language, like C# or VB.Net.
22
Validation Summary The ValidationSummary control does not perform any validation but shows a summary of all errors in the page. The summary displays the values of the ErrorMessage property of all validation controls that failed validation. The following two mutually inclusive properties list out the error message: ShowSummary : shows the error messages in specified format. ShowMessageBox : shows the error messages in a separate window.
23
View state State management means to preserve state of a control, web page, object/data, and user in the application explicitly because all ASP.NET web applications are stateless, i.e., by default, for each page posted to the server, the state of controls is lost.
24
View state is the page-level state management technique used in the ASP.NET page framework to retain the value of controls and page between round trips. Data objects such as hash tables, strings, array objects, array list objects, Boolean values and custom-type converters can be stored in view state. View state is ideally used when the data to be preserved is relatively small and the data need not be secured
25
By default, the view state is switched on and regardless of whether used during a postback, it serializes the information in every control found on the page. To disable the view state for a single control, the EnableViewState property needs to be set as false. The attribute EnableViewStateMac is provided to detect any corruption attempt or technique on the view state.
26
Advantage: Disadvantages:
The mean features of view state are to store the values of control properties and pages found in the concerned page, without the help of a session, preserve the value of the control after the postback operation and to create a custom view state provider for storing view state information in a database. Disadvantages: For large amounts of data, the performance is not optimal, as large values could potentially cause view state to be slow View state can only store values for same page only.
27
WEB CONTROLS Webcontrol class:
Serves as the base class that defines the methods, properties and events common to all controls in the System.Web.UI.WebControls namespace. Some of the properties are mentioned below :- PROPERTY DESCRIPTION BackColor Gets or sets the background color of the Web server control. BorderColor Gets or sets the border color of the Web control. ForeColor Gets or sets the foreground color (typically the color of the text) of the Web server control. Enabled Gets or sets a value indicating whether the Web server control is enabled.
28
PROPERTY DESCRIPTION ID Gets or sets the programmatic identifier assigned to the server control. ViewState Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page. Tooltip Gets or sets the text displayed when the mouse pointer hovers over the Web server control.
29
INPUT CONTROL Input controls let the user enter text data into the application. ASP.NET supports only one input web control: the TextBox. The TextBox behaves like a single-line or multiline edit control, depending on the value of its TextMode property.
30
DISPLAY CONTROLS Display controls simply render text or images to the browser. Control Purpose Image Displays the image specified in the control's ImageUrl property. Label Displays the text specified in the control's Text property. Panel Groups a set of controls (like a Frame control in Windows). Table Displays a table of information. This control has two collections: TableRows, which contains the rows, and TableCells, which contains the columns in a row.
31
ACTION CONTROLS Action controls allow users to perform some action on that page, such as navigating to a different URL, submitting a form, resetting a form's values, or executing a client script. Control Purpose Button Displays a command button that posts a form to the server when clicked. ImageButton Displays an image that posts a form to the server when clicked. LinkButton Displays a hyperlink text that posts a form to the server when clicked. Hyperlink Displays a hyperlink text that navigates from one page to another when clicked.
32
SELECTION CONTROLS Selection controls allow the user to select one or more values from a list. They include both the CheckBox and RadioButton controls, which are designed to work in a group. Control Purpose CheckBox Selects or unselects an option. You can toggle the selection. RadioButton Selects only one option out of a group. You can unselect an option only by selecting another RadioButton control in the group. ListBox Allows the user to select one or more options from a list represented by ListItem controls. This control always occupies a fixed space in the form.
33
Control Purpose DropDownList Allows the user to select only one option out of a list represented by ListItem controls. This control is used where the space in the form is limited. RadioButtonList Presents a list of radio buttons represented by ListItem controls and allows selection of only one option. CheckBoxList Presents a list of checkboxes represented by ListItem controls and allows you to select zero or more of the options.
34
THANK YOU
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.