Online Test ASP.Net 3.5 using C#

 Online Test ASP.Net 3.5 using C#

  1. System.DateTime
  2. System.TimeSpan
  3. System.Globalization.Calendar
  4. System.Globalization.CultureInfo
Answer: Answer is c
Further Reading:
A calendar divides time into units, such as weeks, months, and years. The number, length, and start of the divisions vary in each calendar. Useful resources, Calendar class

  1. HashSet is an unordered collection.
  2. The default EqualityComparer checks whether the element supplied to the HashSet is unique or not.
  3. HashSet provides functionality for "conceptual sets" where the rules for membership can be specified without actually creating all of the items.
  4. All of the above
Answer: Answer is d
Further Reading:
A HashSet collection is not sorted and cannot contain duplicate elements.Useful resources, HashSet collectionHashSet

  1. ASP.NET authentication cannot be used to control access.
  2. ASP.NET authentication handles these by default in a manner equivalent to .aspx pages.
  3. The extension can be associated with aspnet_isapi.dll in IIS for the appropriate directory.
  4. A custom HTTP Request processor must be installed to examine the URL's and determine the appropriate access rights.
Answer: Answer is c
Further Reading:

  1. comAuthenticationLevel
  2. comImpersonationLevel
  3. maxIoThreads
  4. requestQueueLimit
Answer: Answer is a

  1. Load
  2. LoadComplete
  3. PreRender
  4. Init
Answer: Answer is c
Further Reading:
The PreRender event occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls. Useful resources, ASP.NET Page Life Cycle Overview

  1. A certificate must be installed on the server.
  2. The certificate must mach the web address to  prevent a browser warning or error.
  3. The certificate must be issued by an authority recognized by the client computer to  prevent a browser warning or error.
  4. All of the above.
Answer: Answer is d
Further Reading:
Useful resources, SSL Certificates

  1. A Nullable type is a reference type.
  2. An implicit conversion exists from any non-nullable value type to a nullable form of that type.
  3. A predefined conversion from the nullable type S? to the nullable type T? exists if there is a predefined conversion from the non-nullable type S to the non-nullable type T
Answer: Answer is b, c
Further Reading:
Useful resources, Nullable Types

  1. It must be enabled in the web.config of the ASP.Net application.
  2. Forms Authentication must be enabled in the web.config of the ASP.Net Application.
  3. Cookies must be enabled in the browser.
  4. A redirection url must be supplied for successful login.
Answer: Answer is a, b, c
Further Reading:

  1.     @Register
  2. @Include
  3. @Control
  4. @Import
Answer: Answer is a
Further Reading:
The @ Register directive declares the control's tag prefix and the location of the control's assembly. You must use this directive if you want to add user controls or custom ASP.NET controls to a page. Useful resources,ASP.NET Web Page Syntax

  1. You can request that the garbage collector processes a generation if it determines that it is appropriate at specific points in your code    
  2. You can control the intrusiveness of the garbage collector (how often it performs collections) while your program is running    
  3. You can control the intrusiveness of the garbage collector (how often it performs collections) only during application initialization
  4. You should specify LowLatency when using Concurrent Server Garbage Collection to improve memory utilization
Answer: Answer is c
Further Reading:
Useful resources, GC ClassLatency Modes

  1. ApplicationState
  2. SessionState
  3. ViewState
  4. None of the above
Answer: Answer is a
Further Reading:
Application state is a data repository available to all classes in an ASP.NET application. Application state is stored in memory on the server and is faster than storing and retrieving information in a database. Unlike session state, which is specific to a single user session, application state applies to all users and sessions. Useful resources, ASP.NET Application State

  1. Using the @OutputCache directive in the .aspx file.
  2. Setting the HttpCacheProlicy of the Cache property inside the Response object.
  3. Using the Cache property of the Page Object
  4. All of the above.
Answer: Answer is d
Further Reading:
Useful resources, ASP.NET Caching

  1. A hidden variable within the page that is included with each round tip.
  2. A cookie which resides on the client’s computer
  3. A sever side in-process memory cache
  4. Instance member variable of the Page class
Answer: Answer is a
Further Reading:
The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE. Useful resources, Understanding ASP.NET View State

  1. The compiler generates a backing field that is completely inaccessible from the application code.

  2. The compiler generates a backing field that is accessible via reflection.
  3. The compiler generates a code that will store the information separately from the instance to ensure its security.
Answer: Answer is a
Further Reading:
In general, you can’t accessBut there might be different stories. According to the accepted answer of Is it possible to access backing fields behind auto-implemented propertiesyou can do it, but is not confirmed nor provided any reference. So, as of now, our answer is The compiler generates a backing field that is completely inaccessible from the application code. Useful resources,Auto-Implemented Properties

  1. You declare (explicitly or implicitly) the accessibility of the property and get and set assessors, but do not provide any implementation or backing field
  2. You attribute a member field so that the compiler will generate get and set assessors
  3. The compiler creates properties for your class based on class level attributes
  4. They are properties which are automatically invoked as part of the object construction process
Answer: Answer is a
Further Reading:
Useful resources, Auto-Implemented Properties

  1. ApplicationState
  2. SessionState
  3. ViewState
  4. All of the above
Answer: Answer is d
Further Reading:
Useful resources, ASP.NET State Management

  1. Administrator
  2. IUSER_MachineName (where ther MachineName is the actual computer name)
  3. ASPNET
  4. Guest
Answer: Answer is b
Further Reading:
In IIS 6.0, anonymous users are assigned by default to the IUSR_computername account, which is a valid Windows account that is a member of the Guests group. The IUSR_computername account can be defined on a computer or on a domain. Also note that, in IIS 6.0, the IUSR_COMPUTERNAME account has been denied write access to Web content by default. Useful resources,   Allowing Anonymous Access to Web Sites (IIS 6.0)

  1. int
  2. double
  3. long
  4. float
Answer: Answer is a, d
Further Reading:
Reads and writes of the following data types are atomic: bool, char, byte, sbyte, short, ushort, uint, int, float, and reference types. In addition, reads and writes of enum types with an underlying type in the previous list are also atomic. Reads and writes of other types, including long, ulong, double, and decimal, as well as user-defined types, are not guaranteed to be atomic. Useful resources, Atomicity of variable references

  1. It is pure Object Relational (O/R) model.
  2. It is a set of enhancements to the DataSet and DataTable classes.
  3. It requires the use of SQLServer as the database.
  4. Because LINQ is based on Queries, it cannot be used to modify the data in the database
Answer: Answer is a
Further Reading:

Statement X: Use the DataRowCollection.Remove method to immediately delete the row.
Statement Y: Use the DataRow.Delete method to mark the row for deletion when DataRow.AcceptChanges is called.
  1. Statement X is correct and Statement Y is incorrect
  2. Statement X is incorrect and Statement Y is correct
  3. Both Statements X, Y are correct
  4. Both Statements X, Y are incorrect
Answer: Answer is c



  1. They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
  2. Key objects must be immutable for the duration they are used within a HashTable.
  3. Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equality unless the HashTable constructor is provided with an IEqualityComparer parameter.
  4. Each Element in a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement
  5. All of the above
Answer: Answer is e
Further Reading:
Useful resources, Hashtable

  1. They can be declared either static or instance members.
  2. Extension methods can be used to override existing instance methods
  3. Extension methods with the same signature for the same class may be declared in multiple namespace without causing compilation errors.
  4. They must be declared in the same assembley(but may be in different source files)
Answer: Answer is c
Further Reading:
Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive. Useful resources, Extension Methods

  1. Server validation can be used alongside with the client side validation
  2. All Data Posted on server, should be validated
  3. Client side validation typically provide faster response (Feedback) then server validation.
  4. All of the above
Answer: Answer is d
Further Reading:
Useful resources, ASP.NET Validation

  1. More concise syntax
  2. The types for a Lambda Excpression may be omitted
  3. The body of an Anonymous method can not be an expression.
  4. Lambda Expressions permit deferred type inference that anonymous methods do not.
  5. All of the above.
Answer: Answer is a

  1. asp:ScriptManager
  2. asp:AjaxManager
  3. asp:PageManager
  4. asp:ClientScriptManager
Answer: Answer is a
Further Reading:
Useful resources, ScriptManager

  1. Init
  2. PreLoad
  3. Load
  4. Render
Answer: Answer is b
Further Reading:
The viewstate is loaded between the init and the load event. So this also means that if you want to access the property values of a web control after a postback you have to do this after the viewstate has been restored and you can not do this in the page_init event rather it should be done in or after Page_Load event handler. For Useful resources, Understanding ASP.NET View State

  1. UserControl can directly express rendering information via markup; a Custom Server control can’t.
  2. UserControl does not require the use of the @Register directive; a Custom Server control does require it.
  3. UserControl can make use of script based validation;  a Custom Server control can not.
  4. UserControl can represent complete compositate hierarchy; a Custom Server control can not.
Answer: Answer is d
Further Reading:

  1. The actual instantiated class is dynamically created and has a base class defined in the CodeFile.
  2. The actual instantiated class is dynamically created and has a member representing the class defined in the CodeFile.
  3. The actual instantiated class is dynamically created and is a co-class of the class defined in the CodeFile.
Answer: Answer is c
Further Reading:
Useful resources, ASP.NET Web Page Code Model

Class MyClass
{ 
     public event EventHandler MyEvent;
}
  1. public void A_MyEvent(object sender, MyArgs e)
    {
    }
    
  2. public void A_MyEvent(object sender, EventArgs e)
    {
    }
  3. public void A_MyEvent(MyArgs e)
    {
    }
Answer: Answer is a
Further Reading:
Useful resources, Event handler methods

static void F1(params int [] y)
{
}

static void Sample()
{ 

int [] j = new Int32[3];
List k = new List();
// FURTHER READING GOES HERE
}
  1. F1(j);
  2. F1(k);
  3. F1(1, 2, 3);
  4. F1(new [] {1,2,3})
Answer: Answer is b
Further Reading:
F1() expects integer type parameter but k is a list type object. So, F1(k) will generate compile time error.


  1. Including .Net code within the script element with the runat attribute set to server
  2. Including .Net code within the code element
  3. Including .Net code using the @code directive on the page
  4. Including .Net code within the execute attribute of the individual control
Answer: Answer is a

  1. Support is provided for the "Suite B" set of cryptographic algorithms as specified by the National Security Agency (NSA).
  2. Cryptography Next Generation (CNG) classes are supported on XP and Vista systems.
  3. The System.Security.Cryptography.AesManaged class allows custom block size, iteration counts and feedback modes to support any Rijndael based encryption.
  4. None of the above
Answer: Answer is d
Further Reading:
“Suite B”, CNG and System.Security.Cryptography.AesManaged not available under .net 3.5Also, Cryptography API Next Generation(CNG) is available from Windows Vista™and onward.Useful resources,Cryptography,AesManagedclass

  1. ApplicationException
  2. DataMisalignedException
  3. ExecutionEngineException
  4. SystemException
Answer: Answer is a
Further Reading:
The exception that is thrown when a non-fatal application error occurs. Useful resources,ApplicationException

  1. Bringing various existing communication technologies into a unified environment.
  2. Cross vendor/platform communication.
  3. Support for asynchronous communications.
  4. Support for distributed applications based on technologies such as MSMQ and/or COM+
  5. All of the above
Answer: Answer is e
Further Reading:
Useful resources, What is WCFWCF

  1. The DataReader provides a cursor that can be used to move forward and backwards through the result.
  2. The DataReader provides random access capabilities on the result.
  3. The DataReader can provide the Schema information of the result to the application code.
Answer: Answer is c
Further Reading:

  1. Propagate container related events to the child controls.
  2. Propagate child events up to control hierarchy
  3. Distribute events between peer child controls.
  4. Translate control unhandled control events into exceptions.
Answer: Answer is b
Further Reading:
The ASP.NET page framework provides a technique called event bubbling that allows a child control to propagate events up its containment hierarchy. Useful resources, Event Bubbling

  1. <%#    %>
  2. <%--   --%>
  3. <--   -->
  4. <#  >
Answer: Answer is a
Further Reading:
ASP.NET introduces a new declarative syntax, <%# %>. This syntax is the basis for using data binding in an .aspx page. All data binding expressions must be contained within these characters.Useful resources,ASP.NET data binding

  1. Remove the cookie from the System.Web.UI.Page.Request.Cookies collection.
  2. Remove the cookie from the System.Web.UI.Page.Request.Browser.Cookies collection.
  3. Set the Expires property to DataTime.Now for a cookie in the Web.UI.Page.Response.Cookies
  4. Remove the cookie from the System.Web.UI.Page.Response.Cookies collection.
Answer: Answer is c
Further Reading:
You cannot directly delete a cookie on a user's computer. However, you can direct the user's browser to delete the cookie by setting the cookie's expiration date to a past date. The next time a user makes a request to a page within the domain or path that set the cookie, the browser will determine that the cookie has expired and remove it. Useful resources, How to: Delete a Cookie

  1. The DataSets and DataTables objects requires continuous connection to the database
  2. All tables in a dataset must come from the same database
  3. A given instance of a DataTable can be in only one DataSet
  4. Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes
Answer: Answer is d
Further Reading:

Statement X: DateTimeOffset values can be converted to DateTime values and vice versa.
Statement Y: DateTimeOffset does not supports arithmetical operations
  1. Statement X is incorrect and Statement Y is correct
  2. Statement X is correct and Statement Y is incorrect
  3. Both Statements X, Y are correct
  4. Both Statements X, Y are incorrect
Answer: Answer is b
Further Reading:
Useful resourcesDateTimeOffsetStructure



  1. ServiceContract
  2. OperationContract
  3. DataContract
  4. MessageContract
Answer: Answer is a
Further Reading:

  1. System.Web.Mail is not supported under version 3.5 of the Framework
  2. System.Web.Mail is deprecated under version 3.5 of the Framework, and it is officially recommended that System.Net.Mail be used.
  3. System.Web.Mail is the preferred solution when using IIS hosted applications.
  4. There are no functional differences; the items were moved to a new namespace to better reflect their applicability
Answer: Answer is b
Further Reading:
Useful resources, System.Net.Mail ,System.Web.Mail

  1. WebUIValidation.js
  2. ClientValidation.js
  3. AspNetValidation.js
  4. USerValidation.js
Answer: Answer is a
Further Reading:
By default, Client side validation are defined in a script library called WebUIValidation.js. Useful resources, ASP.NET Validation

  1. <exception>
  2. <code>
  3. <summary>
  4. All of them
Answer: Answer is d
Further Reading:

  1. Setting the ToolTip property of a control to a string containing the information.
  2. using the open method of the browser window object to open a new browser window and display a help related ASP.NET page.
  3. Using the showHelp method of the browser window object to display a topic from a compiled help file (.chm).
  4. All of the above
Answer: Answer is c

  1. Styles can be applied to all elements having the same CSS Class attribute.
  2. Styles can be applied to specific elements based on their ID attribute.
  3. Styles can be applied to elements based on their position in a hierarchy.
  4. Styles can be used to invoke script based code.
  5. All of the above.
Answer: Answer is e
Further Reading:
Useful resources, CSS Overview

  1. It is optimized for single processor/core operations.
  2. A thread which has a read lock on a resource may not acquire a write lock on the same resource.
  3. By default, a thread which has a read lock on a resource and attempts to get another read lock on the same resource will throw an exception
Answer: Answer is a
Further Reading:
Useful resources, ReaderWriterLockSlim Class

  1. A specific number of requests to the application process.
  2. A percentage of physical memory utilized by the process.
  3. A specific time interval.
  4. A specific date and time.
  5. All of the above
Answer: Answer is a, c, d
Further Reading:

  1. It must contain a from clause.
  2. It must begin with a select clause.
  3. It can end with a group clause
Answer: Answer is b, c
Further Reading:
A query expression is a query expressed in query syntax. A query expression is a first-class language construct. It is just like any other expression and can be used in any context in which a C# expression is valid. A query expression consists of a set of clauses written in a declarative syntax similar to SQL or XQuery. Each clause in turn contains one or more C# expressions, and these expressions may themselves be either a query expression or contain a query expression.

  1. Only the UpdatePanel and any child controls go through the server lifecycle.
  2. The entire page always goes through the entire lifecycle.
  3. Only the UpdatePanel which initiated the Postback and its child controls can provide updated information.
  4. UpdatePanels can not be used with Master Pages.
  5. TreeView,Menu,Substitution and Validatio controlscan not be used within and UpdatePanel
Answer: Answer is a
Further Reading:
Useful resources, UpdatePane



Online Test ASP.Net 3.5 using C#

  1. The Passport SDK must be installed.
  2. Passport authentication requires a network path between the Client and the Microsoft Passport Server.
  3. Passport Authentication provides persistent authentication across sessions
Answer: Answer is b
Further Reading:

  1. 1
  2. 25
  3. 250
  4. 100
  5. 500
Answer: Answer is b
Further Reading:
There is one thread pool per process.You can set the upper limit of threads that the pool will create by calling Thread.Pool.SetMaxThreads, the defaults are,
25 per core in 2.0
250 per core in 3.5
1023 in 4.0 32 bit
32768 in 4.0 64 bit.
Useful resources, ThreadPool

  1. Expression trees are a data structure which can be initially composed using language syntax.
  2. Expression trees are a dynamically generated code which is executed to perform the desired function.
  3. Expression trees can be modified once they are created
Answer: Answer is a
Further Reading:
Useful resources,Expression Trees

  1. All elements in the initialize list must be of the same type.
  2. All elements in the initialize list must be implicitly convertible to a known type of at least one member in the initialize list.
  3. All elements in the initialize list must be implicitly convertible to common type which is a base type of the items actually in the list
  4. There are no restrictions on the items in the initializer list as the array is not declared to be a specific type
  5. None of the above
Answer: Answer is d
Further Reading:
Useful resources, Implicitly Typed Arrays

  1. Enabling debug information in the .NET Assembly.
  2. Setting the debug attribute of the compilation element to true in the web.config file.
  3. Enabling ASP.NET debugging in the IIS metabase.
Answer: Answer is b
Further Reading:

  1. System.Web.UI.WebControls.Xml.
  2. System.Web.UI.WebControls.Xslt.
  3. System.Web.UI.WebControls.Substitution.
  4. System.Web.UI.WebControls.Transform
Answer: Answer is a
Further Reading:
Useful resources, Xml Class

  1. void Sample1(object o)
    {
      int i = (int)o;
    }   
    
  2. void Sample1(ValueType vt) 
    {
      int i = (int)vt; 
    }   
    
  3. enum E { Hello, World} void Sample1(System.Enum et) 
    {
      E e = (E) et; 
    }   
    
  4. class C {
      public int Value { get; set; }
    }
    void Sample1(C vt)
    {
      int i = vt.Value;
    } 
    
Answer: Answer is d
Further Reading:
Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type. Unboxing extracts the value type from the object. Boxing is implicit; unboxing is explicit. In (d), it’s not followed the rules of unboxing. So, it’s not unboxing conversion. Useful resources, Boxing and Unboxing

  1. ApplicationState
  2. SessionState
  3. ViewState
  4. None of the above
Answer: Answer is d
Further Reading:
Information about a control created at design time stored in Script LibraryDesign-time controls are implemented using script stored in the Script Library. Do not alter the contents of the library, or the controls might not work properly. Useful resources, Creating Forms with Design-Time Controls

  1. creating an instance of System.runtime.memoryFailpoint and monitoring for an insufficient memory Exception.
  2. Creating an instance of system.runtime.memoryFailpoint and monitoring for an out of memory Exception.
  3. There is no supported application level means determine if the specific amount of memory is available
  4. Using static methods of System.Runtime.MemoryFailPoint and checking the return value
Answer: Answer is a
Further Reading:
Useful resources, MemoryFailPoint Class

string t = @"This\Is\a\Test";
Response.Write(t);
  1. ThisIsaTest
  2. This\Is\a\Test
  3. It will give a compilation error: Unrecognized escape sequence
Answer: Answer is b
Further Reading:
Useful resources, String literals



  1. PreInit
  2. Init
  3. PreLoad
  4. PreRender
  5. Render
Answer: Answer is a
Further Reading:
In a handler for the page's PreInit method, set the page's Theme property. Useful resources, Apply ASP.NET Themes Programmatically

  1. C# allows non-type templateparameters.
  2. C# supports explicit specialization.
  3. C# allows the type parameter to be used as the base class for generic type.
  4. C# allows a generic type parameter itself to be a generic.
  5. C# enforces that all codes are valid for all types of parameters
Answer: Answer is e
Further Reading:
Useful resources,C# Generics

  1. Creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
  2. Creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
  3. There is no supported application level means to determine if a specific amount of memory is available
Answer: Answer is a
Further Reading:
To use a memory gate, you must create a MemoryFailPoint object and specify the number of megabytes (MB) of memory that the next operation is expected to use. If enough memory is not available, anInsufficientMemoryException exception is thrown. Useful resources, MemoryFailPoint

  1. All elements in the initializer list must be of the same type.
  2. All elements in the initializer list must be implicitly convertible to a known type which is the actual type of at least one member in the initializer list.
  3. ll elements in the initializer list must be implicitly convertible to common type which is a base type of the items actually in the list
Answer: Answer is b
Further Reading:
ou can create an implicitly-typed array in which the type of the array instance is inferred from the elements specified in the array initializer. Useful resources, Implicitly Typed Arrays

var sample = "Hello World";
  1. The actual type is determined at compilation time, and has no impact on the runtime
  2. The actual type is determined at runtime, and late binding takes effect.
  3. "var" itself is a specific type defined by the framework, and no special binding takes place
Answer: Answer is a
Further Reading:
It is important to understand that the var keyword does not mean "variant" and does not indicate that the variable is loosely typed, or late-bound. It just means that the compiler determines and assigns the most appropriate type. Useful resources, Implicitly Typed Local Variables

  1. The interval will never restart before the page postback is complete
  2. The timer control must be located outside of the UpdatePanel
  3. If the timer expiration triggers a postback while a previous postback is in progress, the first postback is canceled
  4. The timer must always be specified as a trigger for the updatepanel which is to be update when the interval expires
Answer: Answer is d
Further Reading:
When timer control inside an UpdatePanel Control, the JavaScript timing component is re-created only when each postback finishes. Therefore, the timed interval does not start until the page returns from the postback. But, if the timer controls is outside an UpdatePanel control, the JavaScript timing component continues to run as the postback is being processed. In this case, if a new postback is initiated while an earlier postback is being processed, the first postback is canceled. Useful resources, Timer Control

  1. Collection Class must implement System.Collections.Generic.ICollection<T>
  2. Collection Class must implement System.Collections.Generic.IList<T>
  3.     Collection Class must implement System.Collections.Generic.ICollection<T>

    or

       Each of the Items in the Initializer List will be passed to the Add(T item) method
Answer: Answer is c
Further Reading:
In order to work with Collection initializers, a class must implement IEnumerable (not generic) and it must have an .Add() method.The method does not have to be Add(T) - it will work with non-generic collections as well.  The objects in the initialization list must match a valid Add(arg) method on the collection class. Useful resources,collection classesobject and collection initializer

  1. Examining the UserLanguage property of current Request object.
  2. Examining the CurrentCulture property of the current Request object.
  3. Examining the Language property of the current Page object.
Answer: Answer is a
Further Reading:
Request.UserLanguages property returns the Web browser's current language as a string. Useful resources, CurrentCulture Property

  1. WS-Addressing
  2. WS-MetadataExchange
  3. WS-Security
  4. WS-Atomic Transaction
  5. All of the above
Answer: Answer is e
Further Reading:
Useful resources, WCF

From Read4Learn.com




Share this article :

+ comments + 1 comments

July 27, 2018 at 6:03 PM

This blog gives very important info about .Net Thanks for sharing
.Net Online Training

Post a Comment

 
Copyright © 2014. Mominul's Diary - All Rights Reserved
Developed by Mominul Islam