• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/33

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

33 Cards in this Set

  • Front
  • Back
Dynamic contronls view state
when adding dynamic controls that need to utilize view state, these controls will need to be added during the Page's Init event as opposed to the Load event
Loading view state
It happens when the page has been posted back. During this stage, the view state data that had been saved from the previous page visit is loaded and recursively populated into the control hierarchy of the Page. It is during this stage that the view state is validated
Loading Postback data
Web controls in a Web Form remember their values across postback. That is, if you have a TextBox Web control on a page and the user enters some value into the TextBox and posts back the page, the TextBox's Text property is automatically updated to the user's entered value. This happens because the TextBox Web control implements the IPostBackDataHandler interface, and the Page class hands off the appropriate value to the TextBox class, which then updates its Text property.
Server controls and its postback data
Server controls remember their values across postback if they use the IPostBackDataHandler interface and implement the LoadPostData() method
Role of View State
View state's purpose in life is simple: it's there to persist state across postbacks. For an ASP.NET Web page, its state is the property values of the controls that make up its control hierarchy.
ViewState Property
whenever a control's property is read, the control's ViewState is consulted. If there is not an entry in the ViewState, then the default value for the property is returned. When the property is assigned, the assigned value is written directly to the ViewState.
Storing info in the Page's ViewState Property (Page itself is a control)
Since the Page class is derived from the System.Web.UI.Control class, it too has a ViewState property. Can use this property to persist page-specific and user-specific information across postbacks. In code-behind, ViewState[keyName] = value
Example of using the Page's ViewState Property
The canonical example is in creating a pageable, sortable DataGrid (or a sortable, editable DataGrid), since the sort expression must be persisted across postbacks. If the DataGrid's data is first sorted, and then paged, when binding the next page of data to the DataGrid it is important that you get the next page of the data when it is sorted by the user's specified sort expression. The sort expression therefore needs to be persisted in some manner. There are assorted techniques, but the simplest, in my opinion, is to store the sort expression in the Page's ViewState.
Where is Page ViewState property stored?
On all page visits, during the save view state stage the Page class gathers the collective view state for all of the controls in its control hierarchy and serializes the state to a base-64 encoded string. This is the string that is emitted in the hidden __VIEWSTATE form field.
Disable a control's ViewState
By default, all controls in the control hierarchy will record their view state when their SaveViewState() method is invoked. To specify that a control should not save its view state or the view state of its children controls by setting the control's EnableViewState property to False (the default is True).
Disable the Page's ViewState
The EnableViewState property is defined in the System.Web.UI.Control class, so all server controls have this property, including the Page class. To indicate that an entire page's view state need not be saved by setting the Page class's EnableViewState to False. (This can be done either in the code-behind class with Page.EnableViewState = false; or as a @Page-level directive—<%@Page EnableViewState="False" %>.)
What is a .snk file?
Strongly Named Key
.snk facts #1
applies to a .NET assembly, to sign your compiled binaries so they can be placed in a machine's GAC
What is considered to a be a strongly named assembly?
assembly name is defined by
--- name
--- version
--- culture info
--- public token key
--- digital signature
.snk facts #2
composed of a key pair (private key, publick key)
How does .snk private key work?
The private key is used to encrypt the "hash" (or checksum) generated from the assembly contents. The signed hash is stored in the assembly with the public key.
How does .snk public key work?
The public key is embedded in the assembly manifest. If the assembly was tampered with, the hash value generated by the public key will not match the hash stored with the assembly. Assembly loading is aborted.
How does .snk the whole thing work?
When user needs to verify the assembly content, they generate a hash based on the assembly content and use the public key to decrypt the hash that came with the assembly (the hash generated by the private key, owned by the programmer). If the 2 hashes match, assembly is verified.
.snk facts #3
Can't generate strongly named assembly that references non-strongly named assemblies
Where to generate a .snk?
.snk is the key produced by the sn.exe utility from the Framework Utility Set.
Javascript equality operators
=== and !=== returns F if the 2 operands are of different data types.
Javascript number type
has only 1 number type, everything is double
Javascript arrays
array elements do not have to be the same type, meaning [0]="Hello", [1]=100, [2]=null, [3]=["A", "B"], etc.
Javascript class
Javascript does not have class, it uses objects but you can simulate a function to return an object (like a class).
Javascript variable scope
use "var" to declare local variable, else, all variables are global. There is NO block scope.
.snk facts #4
To make the hash code secure, it's encoded by the private key data in the *.snk file to create a digital signature in the assembly's CLR header data.
.snk private key
The private key is not in the manifest. It's used to digitally sign the contents of the assembly.
Static Method
can be invoked directly from the class level without creating an object.
What is a .NET Assembly?
a unit of physical code grouping
Purpose of .NET Assembly
Security, Type Identity, Reference Scope, Versioning, Deployment
What is a .NET Namespace?
A unit of logical code grouping
What's in an Assembly Manifest?
Name & Version
Culture or language the assembly supports
Public Key
List of files in the assembly with hash info
Info on exporter types
Info on referenced assemblies
How to add a signed assembly to GAC?
use GAUTIL.exe to add a signed assembly to the machine's Global Assembly Cache.