Interview Questions ASP.NET 1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process. inetinfo.exe is theMicrosoft 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 tothe actual worker process aspnet_wp.exe. 2. What’s the difference between Response.Write() andResponse.Output.Write()? The latter one allows you to write formattedoutput. 3. What methods are fired during the page load? Init() - when the pageis instantiated, Load() - when the page is loaded into server memory,PreRender() - the brief moment before the page is displayed to the user asHTML, Unload() - when page finishes loading. 4. Where does the Web page belong in the .NET Framework class hierarchy?System.Web.UI.Page 5. Where do you store the information about the user’s locale? System.Web.UI.Page.Culture 6. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"? CodeBehind is relevant to Visual Studio.NET only. 7. 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 eventhandlers, allowing the main DataGrid event handler to take care of its constituents. 8. Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler? It’s the Attributesproperty, the Add function inside that property. So btnSubmit.Attributes.Add("onMouseOver","someClientCod e();") 9. What data type does the RangeValidator control support? Integer,String and Date. 10. Explain the differences between Server-side and Client-side code? Serverside code runs on the server. Client-side code runs in the clients’ browser. 11. What type of code (server or client) is found in a Code-Behind class? Server-side code. 12. Should validation (did the user enter a real date) occur server-side or client-side? Why? Client-side. This reduces an additional request to the server to validate the users input. 13. What does the "EnableViewState" property do? Why would I want it on or off? It enables the viewstate on the page. It allows the page to save the users input on a form. 14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site. 15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset? · 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. 16. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? This is where you can set the specific variables for the Application and Session objects. 17. If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users? Maintain the login state security through a database. 18. Can you explain what inheritance is and an example of when you might use it? When you want to inherit (use the functionality of) another class. Base Class Employee. A Manager class could be derived from the Employee base class. 19. Whats an assembly? Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN 20. Describe the difference between inline and code behind. Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page. 21. Explain what a diffgram is, and a good use for one? The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. For reading database data to an XML file to be sent to a Web Service. 22. Whats MSIL, and why should my developers need an appreciation of it if at all? MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. 23. Which method do you invoke on the DataAdapter control to load your generated dataset with data? The .Fill() method 24. Can you edit data in the Repeater control? No, it just reads the information from its data source 25. Which template must you provide, in order to display data in a Repeater control? ItemTemplate 26. How can you provide an alternating color scheme in a Repeater control? Use the AlternatingItemTemplate 27. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control? You must set the DataSource property and call the DataBind method. 28. What base class do all Web Forms inherit from? The Page class. 29. Name two properties common in every validation control? ControlToValidate property and Text property. 30. What tags do you need to add within the asp:datagrid tags to bind columns manually? Set AutoGenerateColumns Property to false on the datagrid tag 31. What tag do you use to add a hyperlink column to the DataGrid? 32. What is the transport protocol you use to call a Web service? SOAP is the preferred protocol. 33. True or False: A Web service can only be written in .NET? False 34. What does WSDL stand for? (Web Services Description Language) 35. Where on the Internet would you look for Web services? (http://www.uddi.org) 36. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box? DataTextField property 37. Which control would you use if you needed to make sure the values in two different controls matched? CompareValidator Control 38. True or False: To test a Web service you must create a windows application or Web application to consume this service? False, the webservice comes with a test page and it provides HTTP-GET method to test. 39. How many classes can a single .NET DLL contain? It can contain many classes.
ASP.NET is a set of technologies in the Microsoft .NET Framework for building Web applications and XML Web Services. ASP.NET pages execute on the server and generate markup such as HTML, WML or XML that is sent to a desktop or mobile browser. ASP.NET pages use a compiled, event-driven programming model that improves performance and enables the separation of application logic and user interface. ASP.NET pages and ASP.NET XML Web Services files contain server-side logic (as opposed to client side logic) written in Visual Basic .NET, C# .NET, or any .NET compatible language. Web applications and XML Web Services take advantage of the features of the common language runtime, such as type safety, inheritance, language interoperability, versioning, and integrated security.
What is the .NET Framework?
The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of Active Server Pages called ASP.NET.
Runtime Technical Questions
Terminology
What is the common language runtime (CLR)?
The common language runtime is the execution engine for .NET Framework applications.
It provides a number of services, including the following:
Code management (loading and execution)
Application memory isolation
Verification of type safety
Conversion of IL to native code
Access to metadata (enhanced type information)
Managing memory for managed objects
Enforcement of code access security
Exception handling, including cross-language exceptions
Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data)
Automation of object layout
Support for developer services (profiling, debugging, and so on)
What is the common type system (CTS)?
The common type system is a rich type system, built into the common language runtime, that supports the types and operations found in most programming languages. The common type system supports the complete implementation of a wide range of programming languages.
What is the Common Language Specification (CLS)?
The Common Language Specification is a set of constructs and constraints that serves as a guide for library writers and compiler writers. It allows libraries to be fully usable from any language supporting the CLS, and for those languages to integrate with each other. The Common Language Specification is a subset of the common type system. The Common Language Specification is also important to application developers who are writing code that will be used by other developers. When developers design publicly accessible APIs following the rules of the CLS, those APIs are easily used from all other programming languages that target the common language runtime.
What is the Microsoft Intermediate Language (MSIL)?
MSIL is the CPU-independent instruction set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects.
Combined with metadata and the common type system, MSIL allows for true cross-language integration.
Prior to execution, MSIL is converted to machine code. It is not interpreted.
What is managed code and managed data?
Managed code is code that is written to target the services of the common language runtime (see What is the Common Language Runtime?). In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data—data that is allocated and de-allocated by the common language runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class.
Assemblies
What is an assembly?
An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or as accessible by code outside that unit.
Assemblies are self-describing by means of their manifest, which is an integral part of every assembly. The manifest:
Establishes the assembly identity (in the form of a text name), version, culture, and digital signature (if the assembly is to be shared across applications).
Defines what files (by name and file hash) make up the assembly implementation.
Specifies the types and resources that make up the assembly, including which are exported from the assembly.
Itemizes the compile-time dependencies on other assemblies.
Specifies the set of permissions required for the assembly to run properly.
This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The runtime can determine and locate the assembly for any running object, since every type is loaded in the context of an assembly. Assemblies are also the unit at which code access security permissions are applied. The identity evidence for each assembly is considered separately when determining what permissions to grant the code it contains.
The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible.
What are private assemblies and shared assemblies?
A private assembly is used only by a single application, and is stored in that application's install directory (or a subdirectory therein). A shared assembly is one that can be referenced by more than one application. In order to share an assembly, the assembly must be explicitly built for this purpose by giving it a cryptographically strong name (referred to as a strong name). By contrast, a private assembly name need only be unique within the application that uses it.
By making a distinction between private and shared assemblies, we introduce the notion of sharing as an explicit decision. Simply by deploying private assemblies to an application directory, you can guarantee that that application will run only with the bits it was built and deployed with. References to private assemblies will only be resolved locally to the private application directory.
There are several reasons you may elect to build and use shared assemblies, such as the ability to express version policy. The fact that shared assemblies have a cryptographically strong name means that only the author of the assembly has the key to produce a new version of that assembly. Thus, if you make a policy statement that says you want to accept a new version of an assembly, you can have some confidence that version updates will be controlled and verified by the author. Otherwise, you don't have to accept them.
For locally installed applications, a shared assembly is typically explicitly installed into the global assembly cache (a local cache of assemblies maintained by the .NET Framework). Key to the version management features of the .NET Framework is that downloaded code does not affect the execution of locally installed applications. Downloaded code is put in a special download cache and is not globally available on the machine even if some of the downloaded components are built as shared assemblies.
The classes that ship with the .NET Framework are all built as shared assemblies.
If I want to build a shared assembly, does that require the overhead of signing and managing key pairs?
Building a shared assembly does involve working with cryptographic keys. Only the public key is strictly needed when the assembly is being built. Compilers targeting the .NET Framework provide command line options (or use custom attributes) for supplying the public key when building the assembly. It is common to keep a copy of a common public key in a source database and point build scripts to this key. Before the assembly is shipped, the assembly must be fully signed with the corresponding private key. This is done using an SDK tool called SN.exe (Strong Name).
Strong name signing does not involve certificates like Authenticode does. There are no third party organizations involved, no fees to pay, and no certificate chains. In addition, the overhead for verifying a strong name is much less than it is for Authenticode. However, strong names do not make any statements about trusting a particular publisher. Strong names allow you to ensure that the contents of a given assembly haven't been tampered with, and that the assembly loaded on your behalf at run time comes from the same publisher as the one you developed against. But it makes no statement about whether you can trust the identity of that publisher.
What is the difference between a namespace and an assembly name?
A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under the control of the developer. For example, types MyCompany.FileAccess.A and MyCompany.FileAccess.B might be logically expected to have functionality related to file access. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality, such as the Microsoft® ASP.NET application framework, or remoting functionality. Design tools can make use of namespaces to make it easier for developers to browse and reference types in their code. The concept of a namespace is not related to that of an assembly. A single assembly may contain types whose hierarchical names have different namespace roots, and a logical namespace root may span multiple assemblies. In the .NET Framework, a namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.
Application Deployment and Isolation
What options are available to deploy my .NET applications?
The .NET Framework simplifies deployment by making zero-impact install and XCOPY deployment of applications feasible. Because all requests are resolved first to the private application directory, simply copying an application's directory files to disk is all that is needed to run the application. No registration is required.
This scenario is particularly compelling for Web applications, Web Services, and self-contained desktop applications. However, there are scenarios where XCOPY is not sufficient as a distribution mechanism. An example is when the application has little private code and relies on the availability of shared assemblies, or when the application is not locally installed (but rather downloaded on demand). For these cases, the .NET Framework provides extensive code download services and integration with the Windows Installer. The code download support provided by the .NET Framework offers several advantages over current platforms, including incremental download, code access security (no more Authenticode dialogs), and application isolation (code downloaded on behalf of one application doesn't affect other applications). The Windows Installer is another powerful deployment mechanism available to .NET applications. All of the features of Windows Installer, including publishing, advertisement, and application repair will be available to .NET applications in Windows Installer 2.0.
I've written an assembly that I want to use in more than one application. Where do I deploy it?
Assemblies that are to be used by multiple applications (for example, shared assemblies) are deployed to the global assembly cache. In the prerelease and Beta builds, use the /i option to the GACUtil SDK tool to install an assembly into the cache:
gacutil /i myDll.dll
Windows Installer 2.0, which ships with Windows XP and Visual Studio .NET will be able to install assemblies into the global assembly cache.
How can I see what assemblies are installed in the global assembly cache?
The .NET Framework ships with a Windows shell extension for viewing the assembly cache. Navigating to % windir%\assembly with the Windows Explorer activates the viewer.
What is an application domain?
An application domain (often AppDomain) is a virtual process that serves to isolate an application. All objects created within the same application scope (in other words, anywhere along the sequence of object activations beginning with the application entry point) are created within the same application domain. Multiple application domains can exist in a single operating system process, making them a lightweight means of application isolation.
An OS process provides isolation by having a distinct memory address space. While this is effective, it is also expensive, and does not scale to the numbers required for large web servers. The Common Language Runtime, on the other hand, enforces application isolation by managing the memory use of code running within the application domain. This ensures that it does not access memory outside the boundaries of the domain. It is important to note that only type-safe code can be managed in this way (the runtime cannot guarantee isolation when unsafe code is loaded in an application domain).
Garbage Collection
What is garbage collection?
Garbage collection is a mechanism that allows the computer to detect when an object can no longer be accessed. It then automatically releases the memory used by that object (as well as calling a clean-up routine, called a "finalizer," which is written by the user). Some garbage collectors, like the one used by .NET, compact memory and therefore decrease your program's working set.
How does non-deterministic garbage collection affect my code?
For most programmers, having a garbage collector (and using garbage collected objects) means that you never have to worry about deallocating memory, or reference counting objects, even if you use sophisticated data structures. It does require some changes in coding style, however, if you typically deallocate system resources (file handles, locks, and so forth) in the same block of code that releases the memory for an object. With a garbage collected object you should provide a method that releases the system resources deterministically (that is, under your program control) and let the garbage collector release the memory when it compacts the working set.
Can I avoid using the garbage collected heap?
All languages that target the runtime allow you to allocate class objects from the garbage-collected heap. This brings benefits in terms of fast allocation, and avoids the need for programmers to work out when they should explicitly 'free' each object.
The CLR also provides what are called ValueTypes—these are like classes, except that ValueType objects are allocated on the runtime stack (rather than the heap), and therefore reclaimed automatically when your code exits the procedure in which they are defined. This is how "structs" in C# operate.
Managed Extensions to C++ lets you choose where class objects are allocated. If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap. If they don't include the __gc keyword, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method.
For additional information about Garbage Collection see:
How do in-process and cross-process communication work in the Common Language Runtime?
There are two aspects to in-process communication: between contexts within a single application domain, or across application domains. Between contexts in the same application domain, proxies are used as an interception mechanism. No marshaling/serialization is involved. When crossing application domains, we do marshaling/serialization using the runtime binary protocol.
Cross-process communication uses a pluggable channel and formatter protocol, each suited to a specific purpose.
If the developer specifies an endpoint using the tool soapsuds.exe to generate a metadata proxy, HTTP channel with SOAP formatter is the default.
If a developer is doing explicit remoting in the managed world, it is necessary to be explicit about what channel and formatter to use. This may be expressed administratively, through configuration files, or with API calls to load specific channels. Options are:
HTTP channel w/ SOAP formatter (HTTP works well on the Internet, or anytime traffic must travel through firewalls)
TCP channel w/ binary formatter (TCP is a higher performance option for local-area networks (LANs))
When making transitions between managed and unmanaged code, the COM infrastructure (specifically, DCOM) is used for remoting. In interim releases of the CLR, this applies also to serviced components (components that use COM+ services). Upon final release, it should be possible to configure any remotable component.
Distributed garbage collection of objects is managed by a system called "leased based lifetime." Each object has a lease time, and when that time expires, the object is disconnected from the remoting infrastructure of the CLR. Objects have a default renew time-the lease is renewed when a successful call is made from the client to the object. The client can also explicitly renew the lease.
Interoperability
Can I use COM objects from a .NET Framework program?
Yes. Any COM component you have deployed today can be used from managed code, and in common cases the adaptation is totally automatic.
Specifically, COM components are accessed from the .NET Framework by use of a runtime callable wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET Framework-compatible interfaces. For OLE automation interfaces, the RCW can be generated automatically from a type library. For non-OLE automation interfaces, a developer may write a custom RCW and manually map the types exposed by the COM interface to .NET Framework-compatible types.
Can .NET Framework components be used from a COM program?
Yes. Managed types you build today can be made accessible from COM, and in the common case the configuration is totally automatic. There are certain new features of the managed development environment that are not accessible from COM. For example, static methods and parameterized constructors cannot be used from COM. In general, it is a good idea to decide in advance who the intended user of a given type will be. If the type is to be used from COM, you may be restricted to using those features that are COM accessible.
Depending on the language used to write the managed type, it may or may not be visible by default.
Specifically, .NET Framework components are accessed from COM by using a COM callable wrapper (CCW). This is similar to an RCW (see previous question), but works in the opposite direction. Again, if the .NET Framework development tools cannot automatically generate the wrapper, or if the automatic behavior is not what you want, a custom CCW can be developed.
Can I use the Win32 API from a .NET Framework program?
Yes. Using platform invoke, .NET Framework programs can access native code libraries by means of static DLL entry points.
Here is an example of C# calling the Win32 MessageBox function:
Requirements : Favorite editor (whether SDI or MDI )
Method : Simply write the following code into a file and save it as MyTest.exe , then try this out, perform the following steps:
Copy The MyTest.cs and Test.aspx files to a local directory.
Compile MyTest.exe by typing csc MyTest.cs /r:System.Web.dll within a command prompt in the directory.
Type MyTest.exe Test.aspx
One interesting use of this functionality is to pre-process dynamic ASP.NET requests saving the output as static .htm files that you then prop onto a server. You can do this with MyTest.exe by pipeing the output automatically to a static file. For example:
A. This applies only to Visual Basic, not VBScript. B. All variables must be dimensioned before use. C. All variables are dimensioned at run-time. D. Forces all controls to have a SELECTED option. E. Requires all variables be cast as specific datatypes. 2. What should be used in order to determine if the cookie "FavoriteFlavors" in the request object contains more than one entry?
A. Request.Cookies("FavoriteFlavors").HasItems B. Request.Cookies("FavoriteFlavors").Collection.Count C. Request.Cookies("FavoriteFlavors").Dictionary D. Request.Cookies("FavoriteFlavors").HasKeys E. Request.Cookies("FavoriteFlavors").Count 3. When is the Session_OnStart event fired?
A. Upon every request from an application by a client for an .asp document. B. Upon the first request from an application by a client for any file in the application. C. Upon the first request for an .asp document from an application by a client. D. Upon the first request for the global.asp file, in which the event handler is located. E. Upon the first request for an .htm or .asp document from an application by client 4. What does Internet Information Server (IIS) assume to be the default language for Active Server Pages?
A. Jscript B. JavaScript C. JAVA D. VBScript E. ECMAScript 5. What should the developer use in order to have an Active Server Page (ASP) invoke a stored procedure on a SQL Server database?
A. ADO B. RDO C. RDS D. OLEDB E. None of the above. 6. ‘onStart' and 'onEnd' are events of what object(s)?
A. Application only. B. Session only. C. Server only. D. Application and Session only. E. Application, Session, and Server. 7. What must be installed on an IIS4 machine to use the CDONTS e-mail server object?
A. FTP service B. SMTP service C. IIS administrator D. Exchange Server E. IPX/SPX protocol 8. Which line of code would instantiate the Browser Capabilities component?
A. objBrowser = Server.CreateObject("MSWC.BrowserType") B. Set objBrowser = Server.CreateObject("MSWC.BrowserType") C. var objBrowser = Server.CreateObject("MSWC.BrowserType") D. var objBrowser = CreateObject("MSWC.BrowserType") E. var objBrowser = Server.CreateObject("BrowserType") 9. What is the Default ScriptTimeOut for Server Object
A. 20 Sec B. 30 Sec C. 60 Sec D. 90 Sec 10. How many Max Cookies can we Create in Server
A. 10 B. 20 C. 30 D. 40 11. How Many Types of Cookies A. 3 B. 2 C. 1 D. 4 12.What is ASP(Active Server Pages)?
ASP is a server side scripting environment for building dynamic and interactive web pages. Since the scripts run on the server side, the web server does all the processing.
13. What are the advantages of using ASP?
· Minimizes network traffic by limiting the need for the browser and server to talk to each other · Makes for quicker loading time since HTML pages are only downloaded · Allows to run programs in languages that are not supported by the browser · Can provide the client with data that does not reside on the client’s machine · Provides improved security measures since the script cannot be viewed by the browser
14. What is HTML(Hypertext Markup Language)?
It’s a method by which web pages can be built and generally used for formatting and linking text.
15. What are the types of HTML?
· Static HTML – Browser uses HTTP to request HTML file from the Web Server · Dynamic HTML – Browser uses HTTP to request an executable application rather than a Static HTML file
16. What is the difference between ASP and HTML? Or Why ASP is better than HTML?
· ASP executes code on the server side whereas the browser interprets HTML. · ASP can use any scripting languages · Gets feedback from the user and return information to the user · Create pages that will be customized to display only things that will be of interest to a particular user · Can edit contents of a web page by updating a text file or a database rather than the HTML code itself
17. What is a Web Server?
It’s a Computer that provides Web services on the Internet or on a local Intranet. It is designed to locate, address and send out simple HTML pages to all other users who access these pages.
18. What is IIS?
IIS is a Web Server that provides Web services, not only for web pages but also for ftp sites and video and audio services. It integrates with the database facilities of SQL Server.
19. What do you need to run ASP?
A browser and a Web server.
20. What is a Scripting Language?
It permits to create more interactive Web Pages. Validation, formatting of web pages can be done. VBScript, JavaScript are some examples.
21. Which is the default Scripting Language of ASP (server-side)?
VBScript
22. Which is the default Scripting Language on the client side?
JavaScript 23. What is Global.asa file?
It is text file that contains details about an ASP application, such as when it should begin and end. 24. Which is the default Data types in VBScript?
Variant is the default data type in VBScript, which can store a value of any type.
25. What is the Order of precedence for ARITHMETIC Operators.
^, -(negation), *or /, \, mod, + or –
26. Where will you code OPTION EXPLICIT in an ASP application? WHY?
It should be the first statement before the tag because ASP script is processed before the HTML statements.
27. What are Constants? How will you declare a constant?
Constants have values that do not change during the execution of the program. It can be declared using the term CONST. (e.g) Const pi = 3.143
28. What are ARRAYS?
Arrays are variables that store items of similar information. DIM ARRAY1(4) (declares an array with the name array1 with 5 elements)
Gets information from the user. It has five collections by which values can be accessed. They are: QueryString, Form, Cookies, Server Variables & ClientCertificate
33. What is Collection?
Collection is a set of name/value pairs where the information supplied by the client is stored.
34. What is application Object?
Shares information among users of an application. Gives a notification when an application starts or ends.
35. What is Application-scope?
Application-scope means that variables (and objects) can be accessed from any ASP pages that is part of the application.
36. How many global.asa files can an Application have?
Only one global.asa file and it’s placed in the virtual directory’s root.
37. What are the collections of Application Object?
* Contents collection – contains all variables added via scripts in global.asa. * Static collection – contains the names of all objects added via the tag in global.asa.
<%
Response.Write a
%>
In the sample code shown above, what will be written to the
screen? A. 1
B. 2
C. 1, 2
D. 1&2
E. Nothing. 2. <%
Set Application("Thing") =
Server.CreateObject("THINGDOER.thingy")
%> The above code appears in the global.asa file. What would it
accomplish?
A. It would create a "Thing" object and place it in Contents Collection of
the Application object.
B. It would create a "Thing" object and place it in StaticObjects
Collection of the Application object.
C. It would create a "Thing" object and place it in the Application.Buffer
Collection Of the Application object. D. It would create an application-level variable named "Thing" with the
value of the object property "THINGDOER.thingy". E. It would fail to create a "Thing" object because the code requires the
Application.Lock and Application.Unlock methods.
3. <% iPos = Instr("Hello World","r") %>
Referring to the above, what is the value of iPos?
A. 0
B. 1
C. 2
D. 8 E. 9 4. <% varType = rsTest("field1").type %> In the database table, if the datatype for field1 (shown
above) is Number, what is the value of varType?
A. The field value. B. A string description. C. The field name.
D. NULL.
E. An enumerator.
5. What is the program ID (ProgID) for ActiveX Data Objects
in 2-tier and 3-tier database applications?
A. ADO
B. RDODB C. ADODB D. RDS
E. OLEDB
6. Which choice is NOT an ADO collection?
A. Properties B. Records C. Fields
D. Errors
E. Parameters
7. Which will NOT set the scope of an Active Server Component?
A. Setting the [component name].scope property. B. Using the Server.CreateObject method.
C. Placing it in the Session or Application OnStart event
handler.
D. Instantiating the component in the global.asa file.
E. Using the