ASP.NET Flashcards
ASP.NET
What are the namespace available in .net?
Namespace is a logical grouping of class.
■System ■System.Data ■System.IO ■System.Drawing ■System.Windows.Forms ■System.Threading
ASP.NET
What are the two main parts of the .NET Framework?
There are the two main parts of the .NET Framework are :
■The common language runtime (CLR). ■The .NET Framework class library.
ASP.NET
Describe the compilation process for .NET code?
Source code is compiled and run in the .NET Framework using a two-stage process. First, source code is compiled to Microsoft intermediate language (MSIL) code using a .NET Framework-compatible compiler, such as that for Visual Basic .NET or Visual C#. Second, MSIL code is compiled to native code.
ASP.NET
How do you create threading in .NET? What is the namespace for that?
System.Threading.Thread
What is the difference between static or dynamic assemblies?
Assemblies can be static or dynamic.
Static assemblies :
can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on).Staticassemblies are stored on disk in portable executable (PE) files.
Dynamic assemblies :
which are run directly from memory and are not saved to disk before execution.
You can save dynamic assemblies to disk after they have executed.
How many languages .NET is supporting now?
When .NET was introduced it came with several languages. VB.NET, C#, COBOL and Perl, etc. 44 languages are supported.
How many .NET languages can a single .NET DLL contain?
Many
What is metadata?
Metadata means data about the data i.e., machine-readable information about a resource, . Such information might include details on content, format, size, or other characteristics of a data source. In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information.
How many types of Transactions are there in COM + .NET ?
There are 5 transactions types that can be used with COM+.
■Disabled ■Not Supported ■Supported ■Required ■Required New
How many namespaces are in .NET version 1.1?
124
What is the root class in .Net?
system.object is the root class in .net .
What is managed code execution?
The .Net framework loads and executes the .Net applications, and manages the state of objects during program execution. This also provides automatically garbage collections.
What is the strong name in .net assembly?
■Strong Name is similar to GUID (It is supposed to be unique in space and time).
■In COM components. Strong name is only needed when we need to deploy assembly in GAC.
■Strong names use public key cryptography (PKC) to ensure that no one can spoof it. PKC use public key and private key concept. Following are the step to generate a strong name and sign an assembly:
What are the assembly entry points?
An assembly can have only one entry point from DllMain, WinMain or Main.
What are remotable objects in .NET Remoting?
.NET Remoting is a mechanism for communicating between objects which are not in the same process. It is a generic system for different applications to communicate with one another. .NET objects are exposed to remote processes, thus allowing inter process communication. The applications can be located on the same computer, different computers on the same network, or on computers across separate networks.
Microsoft .NET Remoting provides a framework that allows objects to interact with each other across application domains. Remoting was designed in such a way that it hides the most difficult aspects like managing connections, marshaling data, and reading and writing XML and SOAP. The framework provides a number of services, including object activation and object lifetime support, as well as communication channels which are responsible for transporting messages to and from remote applications.
ASP.NET
What namespaces are necessary to create a localized application?
■System.Globalization
■System.Resources
ASP.NET
Which namespaces are used for data access?
■System.Data
■System.Data.OleDB
■System.Data.SQLClient
ASP.NET
What is a SESSION and APPLICATION object?
Session object store information between HTTP requests for a particular user.
Session variables are used to store user specific information where as in application variables we can’t store user specific information.
while application object are global across users.
What is ASP.NET?
ASP.NET is a server side scripting technology that enables scripts (embedded in web pages) to be executed by an Internet server.
ASP.NET provides increased performance by running compiled code.
What is the difference between Classic ASP and ASP.Net?
ASP is Interpreted language based on scripting languages like Jscript or VBScript.
■ASP has Mixed HTML and coding logic.
■Limited development and debugging tools available.
■Limited OOPS support.
■Limited session and application state management.
ASP.Net is supported by compiler and has compiled language support.
■Separate code and design logic possible.
■Variety of compilers and tools available including the Visual studio.Net.
■Completely Object Oriented.
■Complete session and application state management.
■Full XML Support for easy data exchange.
ASP.NET
What is Difference between Namespace and Assembly?
A namespace is just a grouping of related classes. It’s a method of putting classes inside a container so that they can be clearly distinguished from other classes with the same name.The physical grouping is accomplished by an assembly, which equates most directly to a dynamic link library (DLL), COM object, or OCX module.
The .NET CLR contains multiple namespaces, which are spread across many assemblies. For example, ADO.NET is the set of classes located in the System.Data namespace, and ASP.NET is the set of classes located in the System.Web namespace.
In Visual Studio .NET, code is physically organized and structured in assemblies. An assembly is almost identical to a DLL, although one assembly consists of one or more DLL or EXEs.
one assembly can contain one or more namespaces, and one namespace can be contained by one or more assemblies. Each assembly can be configured with a root namespace. If the root namespace value is left blank, the root namespace value defaults to the assembly name.
Differences: 1) A namespace is logically groups classes.An assembly is physical grouping of logical units. 2) An Assembly contains one or more namespaces.
ASP.NET
What is the difference between early binding and late binding?
Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.
ASP.NET
What is the difference between ASP Session State and ASP.Net Session State?
ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.
What is the difference between ASP Session and ASP.NET Session?
Asp.net session supports cookie less session & it can span across multiple servers
ASP.NET
What is reflection?
All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection.
The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.
ASP.NET
What is the difference between Server.Transfer and response.Redirect?
The Server.Transfer () method stops the current page from executing, and runs the content on the specified page, when the execution is complete the control is passed back to the calling page.
While the Response.Redirect () method transfers the control on the specified page and the control is never passed back to calling page after execution.
ASP.NET
What is a PostBack?
The process in which a Web page sends data back to the same page on the server.
What namespace does the Web page belong in the .NET Framework class hierarchy?
System.Web.UI.Page
ASP.NET
What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their event handlers, allowing the main DataGrid event handler to take care of its constituents.
ASP.NET
What is 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.
ASP.NET
What is the difference between static or dynamic assemblies?
Assemblies can be static or dynamic.
Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files.
Dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.
ASP.NET
What are the difference between Structure and Class?
■Structures are value type and Classes are reference type
■Structures can not have constructor or destructors.
■Classes can have both constructor and destructors.
■Structures do not support Inheritance, while Classes support Inheritance.
ASP.NET
What is the differences between dataset.clone and dataset.copy?
Dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data.
Dataset.copy, copies both the dataset structure and the data.
ASP.NET
What is the difference between Custom Control and User Control?
Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.
User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.
What is the difference between ASP Session State and ASP.Net Session State?
ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.
ASP.NET
What is ViewState?
ViewState is a .Net mechanism to store the posted data among post backs. ViewState allows the state of objects to be stored in a hidden field on the page, saved on client side and transported back to server whenever required.
ASP.NET
What is Authentication and Authorization?
Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication.
Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
ASP.NET
What are the types of Authentication?
There are 3 types of Authentication. Windows, Forms and Passport Authentication.
■Windows authentication uses the security features integrated into the Windows NT and Windows XP operating systems to authenticate and authorize Web application users.
■Forms authentication allows you to create your own list/database of users and validate the identity of those users when they visit your Web site.
■Passport authentication uses the Microsoft centralized authentication provider to identify users. Passport provides a way to for users to use a single identity across multiple Web applications. To use Passport authentication in your Web application, you must install the Passport SDK.
ASP.NET
What are the different types of Validation Controls?
There are six types of validation controls available :
■RequiredFieldValidator ■RangeValidator ■RegularExpressionValidator ■CompareValidator ■CustomValidator ■ValidationSummary
ASP.NET
What is the Web User Control?
Combines existing Server and/or HTML controls by using VS.Net to create functional units that encapsulate some aspects of UI. Resides in Content Files, which must be included in project in which the controls are used.
ASP.NET
What namespaces are necessary to create a localized application?
■System.Globalization
■System.Resources
How to Manage State in ASP.Net?
There are several ways to manage a state.
■ViewState ■ QueryString ■Cookies ■Session ■Application
ASP.NET
What are the different types of Caching?
There are three types of Caching :
■Output Caching: stores the responses from an asp.net page.
■Fragment Caching: Only caches/stores the portion of page (User Control)
■Data Caching: is Programmatic way to Cache objects for performance.
ASP.NET
What is Side-by-Side Execution?
The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system,
and even in the same process. This concept is known as side-by-side execution.
ASP.NET
How to view an assembly?
We can use the tool “ildasm.exe” known as “Assembly Disassembler” to view the assembly.
ASP.NET
Which are the namespaces that are imported automatically by Visual Studio in ASP.Net?
There are 7 namespaces which are imported automatically. ■System ■System.Collections ■System.IO ■System.web ■System.web.UI ■System.web.UI.HTMLControls ■System.web.UI.WebControls.
What are the layouts of ASP.NET Pages?
■GridLayout
■FlowLayout
.
GridLayout positions the form object on absolute x and y co-ordinates of the screen.
FlowLayout positions the form objects relative to each other.
ASP.NET
What is Delegates?
Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it. Delegates are generally used as basis of events, which allow any delegate to easily be registered for as event.
ASP.NET
What is a Namespace? What is the use of a namespace?
Namespaces are logical grouping of classes and other types in hierarchical structure.
Namespaces are useful to avoid collision or ambiguity among the classes and type names.
Another use of the namespace is to arrange a group of classes for a specific purpose.
ASP.NET
What’s the difference between Codebehind=”MyCode.aspx.cs” and Src=”MyCode.aspx.cs”?
Visual Studio uses the Codebehind attribute to distinguish the page source or programming logic from the design. Also the src attribute will make the page compile on every request. That is the page will not be compiled in advance and stored in the bin as a dll instead it will be compiled at run time.
ASP.NET
What is datagrid?
The DataGrid Web server control is a powerful tool for displaying information from a data source. It is easy to use; you can display editable data in a professional-looking grid by setting only a few properties. At the same time, the grid has a sophisticated object model that provides you with great flexibility in how you display the data.
ASP.NET
How do you hide the columns?
One way to have columns appear dynamically is to create them at design time, and then to hide or show them as needed. You can do this by setting a column’s “Visible” property.
ASP.NET
What are different types of directives in .NET?
■@Page ■@Control ■@Import ■@Implements ■@Register ■@Assembly ■@OutputCache ■@Reference
ASP.NET
What data type does the RangeValidator control support?
■Integer
■String.
■Date.
ASP.NET
What is cookies?
Cookies are small pieces of text, stored on the client’s computer to be used only by the website setting the cookies. This allows webapplications to save information for the user, and then re-use it on each page if needed
ASP.NET
How many classes can a single .NET DLL contain?
It can contain many classes.
ASP.NET
What methods are fired during the page load?
Init() - when the page is instantiated.
Load() - when the page is loaded into server memory.
PreRender() - the brief moment before the page is displayed to the user as HTML.
Unload() - when page finishes loading.
ASP.NET
What is the difference between Value Types and Reference Types?\
Value Types uses Stack to store the data.
where as Reference type uses the Heap to store the data.
ASP.NET
What is the difference between Server-side scripting and Client-side scripting?
Server side scripting means that all the script will be executed by the server and interpreted as needed. ASP doesn’t have some of the functionality like sockets, uploading, etc.
Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript.
ASP.NET
How do you create a permanent cookie?
Permanent cookies are available until a specified expiration date, and are stored on the hard disk.So Set the ‘Expires’ property any value greater than DataTime.MinValue with respect to the current datetime. If u want the cookie which never expires set its Expires property equal to DateTime.maxValue.
ASP.NET
Which method do you use to redirect the user to another page without performing a round trip to the client?
Server.Transfer
Server.Execute.
ASP.NET
Which method do you use to redirect the user to another page without performing a round trip to the client?
Server.transfer
ASP.NET
What tag do you use to add a hyperlink column to the DataGrid?
< asp:HyperLinkColumn > < / asp:HyperLinkColumn >
ASP.NET
What is web.config file?
Web.config file is the configuration file for the Asp.net web application. There is one web.config file for one asp.net application which configures the particular application. Web.config file is written in XML with specific tags having specific meanings.It includes databa which includes connections,Session States,Error Handling,Security etc.
ASP.NET
What is the difference between in-proc and out-of-proc?
An Inproc is one which runs in the same process area as that of the client giving tha advantage of speed but the disadvantage of stability becoz if it crashes it takes the client application also with it.
Outproc is one which works outside the clients memory thus giving stability to the client, but we have to compromise a bit on speed.
ASP.NET
What is smart navigation?
The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.