.NET basics Flashcards
Common Language Runtime (CLR)
The engine that executes all .NET programs
Common Intermediate Language (CIL)
The language used by the CLR
C# strings and escaped characters
- " (double quote)
- \n (new line)
- \t (horizontal tab)
- \ (backward slash)
Arrays
- string []
- int []
- int [,] (two-dimensional int array)
ArrayList
- Dynamic collection that supports any type of object and allows resizing
- Example:
- ArrayList x = new ArrayList();
Delegates
Can be used as variables to point at methods that accept the same parameters
script runat = “server”
Sets the code to run on the web server, rather than in the user’s web browser
Generics
A class that supports any type of variables or objects
Try parse
- Returns a boolean representing the success or failure of the parse method
- Example:
- bool success = Decimal.TryParse(X.Value, out XX)
if (IsPostBack == false)
Postback verifies that the page is being loaded for the first time. It is used in order to initialize content only on the first load
ListItem Class
- Attributes - Gets a collection of attribute name and value pairs for the ListItem that are not directly supported by the class
- Enabled - Gets or sets a value indicating whether the list item is enabled
- Selected - Gets or sets a value indicating whether the item is selected
- Text - Gets or sets the text displayed in a list control for the item represented by the ListItem
- Value - Gets or sets the value associated with the ListItem
HtmlSelect Class
- Value - Gets the value of the selected item in the HtmlSelect control or sets the SelectedIndex property of the control to the index of the first item in the list with the specified value
- SelectedIndex - Gets or sets the ordinal index of the selected item in an HtmlSelect control
- InnerText - Gets or sets the content between the opening and closing tags of the control with automatic conversion of special characters to their equivalent HTML entities. This property is not supported for this control.(Overrides HtmlContainerControl.InnerText)
Apply a CSS style to an HTML control
ControlName.Style[“AttributeName”] = “AttributeValue”
- InnerHtml
- InnerText
- The HTML content in the control
- The text equivalent of the HTML content in the control
Server.HtmlEncode
Property allowing to display an HTML element as a text element