ASP.NET Flashcards

event handler
Terms Definitions
What is the AnonymousTemplate?
{deny users="?" }{allow users="*" }
session tracking
the tracking of individual clients
What method inherited from Object allows the object to free resources and perform cleanup operations before the garbage-collector comes?
Programmers customize Web Forms by...
adding Web controls.
Property SessionID
contains the session's unique ID; first time a client connects to the Web server, a unique session ID is created for that client; when the client makes additional requests, the client's session ID is compared with the session IDs stores in the Web server's memory.
What namespace should you include when writing a web sercvice?
What directive does VS.NET set when you drag a User Control from the Solution Explorer to a Web form?
Using exception-handling blocks to deal with exceptions in the scope of the procedure is called what?
Structured exception handling
Required Field Validator
ensures that a field receives input
Server controls...
on an ASP.NET Web Form persist data.
What dataset method should you use to save information from the dataset to an XML file?
What method of the dataset should you use to find one particular record in an XML file?
What is the process of assigning a user account to an unknown user?
What two state collections does HttpApplicationState expose?
Contents and StaticObjects
What kind of object holds a parameter that you're passing to a stored procedure
User Control
defined in an external file saved with an .ascx extension. Using .ascx files helps encapsulate frequently used blocks of code.
What are the 6 ASP.NET Validation controls?
1. RequiredFieldValidator
2. CompareValidator
3. RangeValidator
4. RegularExpressionValidator
5. CustomValidator
6. ValidationSummary
If you want to send a formatted mail message or one containing an attachment, what is the best class to use?
What class is created the first time a request is made for a resource in your web app?
How do you tell if a user is authenticated?
To handle errors in statements that might fail because of external conditions, what do you use?
Exception-handling blocks (try-catch-finally)
How do you deny all users?
<deny users = "*" />
How do you deny unauthorized users?
<deny users = "?" />
The GridView is an all-purpose grid control for showing large tables of information. It supports selecting, editing, sorting, and paging. The GridView is the heavyweight of ASP.NET data controls. Its also the successor to the ASP.NET 1.x DataGrid.
Explain the DetailsView.
method ExecuteReader
returns the result of a query in the form of an OleDbDataReader.
What is a ListDictionary?
This is a simple implementation of IDictionary using a singly linked list. It is smaller and faster than a Hashtable if the number of elements is 10 or less. This should not be used if performance is important for large numbers of elements.
What is the LoginView?
Templates, e.g. "You are not logged in" before log in, or user-appropriate links if the user IS logged in.
What data types do the RangeValidator control support?
Integer, String, and Date.
A database connection is opened by...
calling method Open of class OleDbConnection
What do you add to the XML schema to enable searching?
Primary Key
What is faster, the DataView's RowFilter method or the Find/FindRows method?
The Find method, because RowFilter causes the index to be rebuilt, while the Find or FindRows method leverages the current index.
How do you get a reference to a control on a web page, in your code behind?
Use <page>.FindControl( "<control_id>") and cast to the appropriate control type:
What is the use of PasswordRecovery control in ASP.NET 2.0?
PasswordRecovery Control: This control provides the user interface and corresponding functionality to help users retrieve or reset their passwords. The control has three views: User- name, Question, and Success. The Username view allows the user to enter the username for which a password has to be retrieved or reset. The Question view prompts the user for the answer to a question that was entered during registration. The Success view displays a success message after the password has been delivered via e-mail.
In addition to implementing the ICollection interface, what three elements to all collections share?
1. An enumerator (pointer than moves through the collection).

2. Synchronization methods (a SyncRoot property used to create their own thread-safe wrapper)

3. CopyTo method. (used to copy the collection to a single-dimensional array)
LoginName control: This control is a placeholder that displays the username of the user. If the current user is anonymous (that is, not authenticated), this control does not render any output.
The LoginName exposes a FormatString property that you can use to display more than just the username. For example, the FormatString could be set to "Welcome, {0}", which would produce the output "Welcome, John" when John is logged in.
The CreateUserWizard control can also gather a security question and answer from the user if the underlying membership provider supports security questions. The "Walkthrough" section for this application also shows how you can add custom steps to the wiza
What is LoginName control in ASP.NET 2.0?
Cookies property of the Request object
can be used to retrieve cookies from the user's machine.
When does a User Control's Page_Load event run?
Right after the containing Web Form's Page_Load event.
What special thing must you do when including a STA-threaded COM-component (ala Visual Basic) in an ASP.NET page?
In the Page directive, set aspcompat=true

&lt;%@ Page aspcompat=true %&gt;
How do you turn tracing on fro an entire application?
Set the application's &lt;trace&gt; element's Enabled attribute to True in the Web.config file.
How do you preserve persistent data, such as simple variables, in a Web application?
You can preserve data in state variables, such as ApplicationState, SessionState, or ViewState.
Do you have to modify the machine.config to alter password requirements?
No, you can also modify the application's web.config.
How do you bind a control to a database column, in the mark-up?
Use <%# Bind( "ColumnName") %>
Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");
When is the memory for an object placed in Application state removed?
When the object is explicitely removed or replaced. It stays in memory otherise (ie, a 10mb recordset would stay in memory).
When validation controls are set to dynamically display error text, what does that mean?
No HTML space is reserved for the message. In static, HTML space is reserved for the message.
What methods are fired during the page load?
Init() - when the page is instantiatedLoad() - when the page is loaded into server memoryPreRender() - the brief moment before the page is displayed to the user as HTMLUnload() - when page finishes loading.
What steps would you follow and what objects would you use to quickly find the number of records in a database table?
There are two ways to accomplish this task:

1. Use a database connection and a command object to execute a SQL command that returns the number of rows in the table.

2. Use a database connection and data adapter object to create a data set for the table, and then get the number rows in the data set.
How do you import a COM component into an ASP.NET once you've run the Type Library Importer on it?
Copy the assembly into the \bin directory and reference the namespace in the Page directive.

&lt;%@ Page Namespace=&quot;MyAssembly.dll&quot; %&gt;
How can you get more control of how a GridView renders a column?
Convert it to a template column.
What is the use of User Profiles in ASP.NET 2.0?
The membership features in ASP.NET 2.0 let you collect basic user information that is important for authentication, such as username, password, e-mail address, and a secret question/ answer pair for password retrieval. But often you will need to collect and store additional information, such as first name, last name, Web site or Weblog URL, job title, and possibly much more. The new user profile features in ASP.NET 2.0 give you the ability to define additional pieces of information about a user that your application must store. You simply specify in web.config the pieces of information you require and then populate the corresponding fields in a special Profile object at runtime.
How do you display a page in one frame from a hyperlink in another frame?
Use the &lt;a&gt; element' s target attribute to specify the frame to display the page. For example, the following hyperlink displays a page in the main frame of a frameset:

&lt;a href=&quot;AllTheAnswers.aspx&quot; target=&quot;main&quot;&gt;Show the answers!&lt;/a&gt;
Add Event Handlers to controls in ASP.NET 2.0?
Type it in by hand: In this case, you add the method directly to the page class. You must specify the appropriate parameters so that the signature of the event handler exactly matches the signature of the event you want to handle. Youll also need to edit the control tag so that it links the control to the appropriate event handler. (Alternatively, you can use delegates to wire this up programmatically.)
How would you use a cookie to store user information on the server?
1. Create a unique key to identify the user.

2. Save the unique key as a cookie on the user' s computer.

3. Create a file on the server to store user information.

4. Save the user information on the server using the unique key as an index.
How to set default button on a Web Form?
Setting a default button on a Web Form in ASP.NET 2.0In ASP.NET 2.0, you can now set a default button on a page so that when the user presses the Enter key the button is automatically invoked.
contains reusable components that programmers can incorporate into their applications - this makes it unncessary to create new software entirely from the ground up.
provides a bindable, customized view of a DataTable that can be sorted and edited.
What namespace contians classes for creating globally unique identifiers?
Application is a property of what?
object that reads data from a database.
HttpSessionState object
like a cookie, stores name-value pairs; in session terminology, these are called sesion items.; can store any type of object as an attribute value.
Can you create an ASP.NET application in a place other than a location that has been published by IIS as a virtual folder?
To make late-bound calls to a COM-component in ASP.NET, what would you do?
What is the default authentication method when you create a new Web application project?
Windows authentication
What method of the Server object clears the last exception that occured on the server?
What keyword causes an exception to occur?
How would you create a new GUID?
Range Validator
checks that input is within a specified range.
event handler that is called when a page is initialized.
represents a set of data and includes the tables that contain and order the data, in addition to the relationships between the tables.
Where are the descriptions of the web services this project provides stored?
When handling exceptions in error events, what would you use to get information about the exception that occurred?
The Server object.
A User Control's class is based on what base class?
What method returns a reference to an instance of a String?
Why use a DbType.AnsiString parameter instead of DbType.String, here?
param.DbType = DbType.AnsiString;param.Size = 5000;
Microsoft's .NET Framework includes...
tools for porting, or adapting, existing software components to .NET
How much information can you store on a cookie?
4096 bytes
How do you get the role of the authenticated user?
What is the file extension for a web service?
What two controls can fire off postback events?
Button and ImageButton
Do User Controls support Grid Layout, Flow Layout, or both?
Only Flow Layout.
Benefits of Partial ClassesOne of the greatest benefits of partial classes is that they allow a clean separation of business logic and the user interface (in particular, the code that is generated by the Visual Studio Designer). Using partial classes, the
Explain the GridView.
text file stored by a Web site on an individual's computer that allows the site to track the actions of the visitor
Key aspect of .NET strategy...
its independence from a specific programming language
If you want to send a simple text mail message, what is the best class to use?
List two different exception-handling approaches in ASP.NET Web ­applications.
Exceptions can be handled in exception-handling blocks using the Try, Catch, and Finally keywords in Visual Basic .NET or the try, catch, and finally keywords in Visual C#. They can also be handled using Error event procedures at the Global, Application, or Page levels using the Server object' s GetLastError and ClearError methods.
Click the Smarttag (upper-right corner) and select "Convert to Template"
What does * mean, as in
Explain the differences between Server-side and Client-side code?
Server-side code executes on the server. Client-side code executes in the client's browser.
Method ReadLine of class StreamReader
reads a line from a text file
Why does ASP.NET perform validation on both the client and the server?
Client-side validation helps avoid round trips to the server. Validating on the client makes sure that the data is valid before it is submitted, in most cases. However, because validation might be turned off (or maliciously hacked) on the client, data must be revalidated on the server side. This provides full assurance that the data is valid while avoiding as many round trips as possible.
command.ExecuteNonQuery(), where command is a DbCommand object.
How do you add columns to a GridView, using the UI
What is the use of CreateUserWizard control in ASP.NET 2.0?
CreateUserWizard Control: This control provides a wizard-style interface for creating a new user in the membership system. The CreateUserWizard is a lot more than a simple form for entering a username and password. It includes field validation for all of its fields, including optional regular expression validation for e-mail addresses. It prompts the user to enter a proposed password twice and confirms that the passwords match.
ASPX files are sometimes referred to as...
Web forms or Web Form pages.
What page directive links an assembly to the current page?
&lt;%@ Page src = &quot;Pathname&quot; Assembly=&quot;MyAssembly&quot; %&gt;
What is "hashing" used for?
Hashing is a common method for storing passwords. The hash value of a password is calculated by applyinga mathematical function (hash algorithm) to it. The essential property about the hash algorithm is that youcan’t obtain the original password from its hash value (the algorithm is one-way).
What is Partial Classes in Asp.Net 2.0?
Partial Classes Concept in Asp.Net 2.0One of the language enhancements in .NET 2.0 - available to both VB2005 and C# 2.0 programmersis support for partial classes. In a nutshell, partial classes mean that your class definition can be split into multiple physical files. Logically, partial classes do not make any difference to the compiler. During compile time, it simply groups all the various partial classes and treats them as a single entity.
What is the difference between the ApplicationException class and the Exception class?
None, except for the fact that ApplicationException reflects custom exception classes created by the programmer.
What file types do the three ASP.NET authentication modes apply to?
aspx, asax, and other resources processed through the web app's executable. Does not automatically include html or htm files.
In Visual Basic .NET, what is difference between a class module and a code module?

Class modules are instantiated at run time to create objects that provide separate storage for variables and properties in each instance. Code mod­ules do not have instances, so any module-level variables they use are shared among calls to the module' s procedures.
* means "all identities" so all users would be denied.
What does ? mean, as in
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?Valid answers are:
• A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.• A DataSet is designed to work without any continuing connection to the original data source.• Data in a DataSet is bulk-loaded, rather than being loaded on demand.• There's no concept of cursor types in a DataSet.• DataSets have no current record pointer You can use For Each loops to move through the data.• You can store many edits in a DataSet, and write them to the original data source in a single operation.• Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
How dow you restore the default window settings in Visual Studio .NET?
Tools -&gt; Options -&gt; Click Reset Window Layout.
How do you view a list of exceptions types?
Debug -&gt; Exceptions. Visual Studio .NET displays the Exceptions dialog box.
If you need a simple sequential list where the value is discarded when it's accessed, what should you use?
A Queue (first-in, first-out) or a Stack (last-in, first-out)
If you're trying to access a web app that has Windows authentiation enabled over the internet, what happens?
You're prompted to enter your credentials which will be validated against a list of Windows accounts.
What type of code (server or client) is found in a Code-Behind class?
The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.
What is wrong with the following line of code?

You can' t use the Transfer method with HTML pages. It works only with .aspx pages.
This is in contrast to using the built-in BoundField, HyperLinkField, etc.
How do you read a GridView value, using the column name?
To use an XML file with a data set, you must first do what?
Create an XML schema for the dataset.
A master page is an ASP.NET file with the extension .master (for example, MySite.master) with a predefined layout that can include static text, HTML elements and server controls.
The master page is identified by a special @ Master directive that replaces the @ Page directive that is used for ordinary .aspx pages. The @ Master directive can contai
What are the five steps to creating a User Control in a web application?
1) Add a Web User Control page (.ascx) to your project.

2) Draw the visual interface of the control in the designer.

3) Write code to create the control' s properties, methods, and events.

4) Use the control on a Web form by dragging it from the Solution Explorer to the Web form where you want to include it.

5) Use the control from a Web form' s code by declaring the control at the module level and then using the control' s methods, properties, and events as needed within the Web form.
If you to apply more than one skin to a given type of control, you need to create named skins and add a corresponding SkinID property to the control's definition.
How do you put a GridView row into edit mode?
Are cookies case-sensitive?
What method of the HttpApplicationState class unlocks access to the application state for syncronization purposes?
object used to retrieve information from a database and place it in a DataSet.
To find information about the authentication user, what class do you use?
Web.config files
XML-formatted text files that reside in the Web site's root directory. Web.config files typically specify configuration settings, such as authorization settings for the Web site or the appearance of error pages.
makes it possible for e-businesses to communicate effectively with their customers and also improves users' ability to locate desired products and services; to provide personalized services to consumers, e-businesses must be able to recognize clients when they request information from a site.
How do you tell the authentication type being used?
What server control property links the control to a stylesheet?
Is the application state single or multi-threaded?
What namespace would you include if you wanted to create a class that inherits from the ApplicationException class?
What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page takes advantage of...
Microsoft's .NeT Framework, which provides thousand of classes.
Property IsPostBack
returns a value indicating whether the page is being loaded in response to a client postback.
What dataset method should you use to read XML into the dataset?
What file lists the files and settings used at design time?
What are MD5, SHA-0, and SHA-1?
Popular hashing algorithms.
DataView enables...
the creation of different views of the data stored in a DataTable.
HTML controls are...
programmable HTML elements run on the server.
Where are the settings used by the web server when processing a project stored?
What does HttpApplicationState.Contents do?
Exposes all variables added to the application collection by code.
What is the code to send a text message using SmtpMail?
SmtpMail.Send(&quot;[email protected]&quot;, &quot;[email protected]&quot;, &quot;Message text&quot;);

sends a mail from [email protected] to [email protected]
To declaritively control output caching of an ASP.NET page, what do you do?
Set the OutputCache page directive.
Identifying ViewState Contributors
One problem that plagues many Web pages is that ViewState becomes bloated, which causes performance problems when receiving and posting pages. You can use the ASP.NET trace facility to examine the controls that contribute to ViewState.
An ASP.NET page gets compiled.
Compiling improbes the performance and load time of ASP.NET pages because the code is directly executed rather than interpreted.
method LoadDataRow
finds and updates a specific row of a DataTable
If an authorization setting is made in IIS and Web.config, which setting is evaluated first?
IIS then Web.config
What does Application.StaticObjects do?
Exposes all variables added to teh application collection by &lt;object runat=server&gt; in the Global.asax.
The DetailsView is ideal for showing a single record at a time, in a table that has one row per field. The DetailsView supports editing and optional paging controls that allow you to browse through a sequence of records.
Explain the FormView.
What’s the difference between Codebehind="MyCode.aspx.cs" and Src="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.
In .NET, XML elements are...
objects of type XmlElement, which can be created by calling method CreateElement.
What are the major differences between an ASP.NET web application and a windows application?
1. Client/server architecture.
2. Runs under CLR using managed code.
3. User interface is displayed in an Internet browser using Web Forms.
How many pages can access the Application state at the same time?
Any number. Technically all HttpHandler and HttpModule instances.
What is LoginStatus?
Displays a Login link if the user is NOT logged is, or a Logout link if the user IS logged in.
Describe the role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe in the page loading process.
inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe.
What exe allows you to view and manipulate the contents of the GAC and download cache?
Gacutil.exe (Global Assembly Cache Tool)
What exe would you use to manage keys, signature generation, and signature verification for strong-named assemblies?
Sn.exe (Strong Name tool)
Displays a column from the database.
Why are skins easy from the developer's perspective?
The options available for password retrieval are determined in part by the Membership provider used to provide membership services. ASP.NET 2.0 includes a provider for Microsoft SQL Server. This support password retrieval and security questions. Other pro
What is LoginStatus control in ASP.NET 2.0?
method Read of class OleDbDataReader
accesses a row from the results of the query.
How do you send mail from the server?
Use the SmtpMail or MailMessage class.
How do you reuse a database connection component throughout a Web application?
Add the database connection component to the Global.asax file, then create a state variable in the Application_Start or Session_Start event procedures to share the connection with the Web forms in the application.
What is the difference between Eval() and Bind()?
Both return the value of their reference, but Eval() is one-way -- display only -- and Bind() is two-way -- display AND UPDATE.
method WriteLine of class StreamWriter
used to write a line of text to a file.
To cache pages based on a property of a control, what do you do?
Use the VaryByControl of the OutputCache directive.

&lt;%@ OutputCache=10 VaryByControl %&gt;
If you try to access properties of a User Control in the web form's Page_Load event, what will happen?
You'll see the User Control's properties as they are initially set. This is because the User Control's code does not run until after the Web form's Page_Load event.
When running an MTS component in ASP.NET, what do you first need to do?
Set the account under which the COM component runs to a special account created for this purpose.
When you know the exact length of the strings you’re storing in a table field, it’s better to use the Chardata type instead of VarChar.
What is a composite primary key?
What are the two approaches to storing and retrieving user information thorugh cookies?
1. Store all the information as a cookie on the client's machine.

2. Store an identification key on the client's machine, and then retrieve user information from a data source on the server using that identification key.
How do you remove a cookie from the client's machine?
Set the cookie's Expires property to DateTime.Now
In the RowCancelingEdit event, set the grid.EditIndex = -1.
How do you tell a GridView about a table's primary keys?
How do you create an XML file in Visual Studio .NET?
Choose Add New Item from the Project menu. Select XML File from the Templates list.
It's an ASP.NET control to which another control can easily be added dynamically, at run-time.
How can you use a GUI to manage your web.config application settings?
In Visual C#, how do you declare a method to make it available without having to first instantiate an object from the class?

To create a method that can be called without instantiating an object, declare that method as static.
Some hold that it rhymes with "squid", others say "fluid". Does it matter? :)
When do you want to use Char the Char datatype, in SQL Server, as opposed to VarChar?
/ 169

Leave a Comment ({[ getComments().length ]})

Comments ({[ getComments().length ]})


{[ comment.comment ]}

View All {[ getComments().length ]} Comments
Ask a homework question - tutors are online