Online Test ASP.Net 3.5 using C#
- System.DateTime
- System.TimeSpan
- System.Globalization.Calendar
- 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
- HashSet is an unordered collection.
- The default EqualityComparer checks whether the element supplied to the HashSet is unique or not.
- HashSet provides functionality for "conceptual sets" where the rules for membership can be specified without actually creating all of the items.
- All of the above
Answer: Answer is d
Further Reading:
A HashSet collection is not sorted and cannot contain duplicate elements.Useful resources, HashSet collection, HashSet
- ASP.NET authentication cannot be used to control access.
- ASP.NET authentication handles these by default in a manner equivalent to .aspx pages.
- The extension can be associated with aspnet_isapi.dll in IIS for the appropriate directory.
- A custom HTTP Request processor must be installed to examine the URL's and determine the appropriate access rights.
Answer: Answer is c
- comAuthenticationLevel
- comImpersonationLevel
- maxIoThreads
- requestQueueLimit
Answer: Answer is a
- Load
- LoadComplete
- PreRender
- 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
- A certificate must be installed on the server.
- The certificate must mach the web address to prevent a browser warning or error.
- The certificate must be issued by an authority recognized by the client computer to prevent a browser warning or error.
- All of the above.
Answer: Answer is d
- A Nullable type is a reference type.
- An implicit conversion exists from any non-nullable value type to a nullable form of that type.
- 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
- It must be enabled in the web.config of the ASP.Net application.
- Forms Authentication must be enabled in the web.config of the ASP.Net Application.
- Cookies must be enabled in the browser.
- A redirection url must be supplied for successful login.
Answer: Answer is a, b, c
- @Register
- @Include
- @Control
- @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
- You can request that the garbage collector processes a generation if it determines that it is appropriate at specific points in your code
- You can control the intrusiveness of the garbage collector (how often it performs collections) while your program is running
- You can control the intrusiveness of the garbage collector (how often it performs collections) only during application initialization
- You should specify LowLatency when using Concurrent Server Garbage Collection to improve memory utilization
Answer: Answer is c
Further Reading:
Useful resources, GC Class, Latency Modes
- ApplicationState
- SessionState
- ViewState
- 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
- Using the @OutputCache directive in the .aspx file.
- Setting the HttpCacheProlicy of the Cache property inside the Response object.
- Using the Cache property of the Page Object
- All of the above.
Answer: Answer is d
- A hidden variable within the page that is included with each round tip.
- A cookie which resides on the client’s computer
- A sever side in-process memory cache
- 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
- The compiler generates a backing field that is completely inaccessible from the application code.
The compiler generates a backing field that is accessible via reflection.- 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 access. But there might be different stories. According to the accepted answer of Is it possible to access backing fields behind auto-implemented properties, you 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
- You declare (explicitly or implicitly) the accessibility of the property and get and set assessors, but do not provide any implementation or backing field
- You attribute a member field so that the compiler will generate get and set assessors
- The compiler creates properties for your class based on class level attributes
- They are properties which are automatically invoked as part of the object construction process
Answer: Answer is a
- ApplicationState
- SessionState
- ViewState
- All of the above
Answer: Answer is d
- Administrator
- IUSER_MachineName (where ther MachineName is the actual computer name)
- ASPNET
- 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)
- int
- double
- long
- 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
- It is pure Object Relational (O/R) model.
- It is a set of enhancements to the DataSet and DataTable classes.
- It requires the use of SQLServer as the database.
- Because LINQ is based on Queries, it cannot be used to modify the data in the database
Answer: Answer is a
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.
- Statement X is correct and Statement Y is incorrect
- Statement X is incorrect and Statement Y is correct
- Both Statements X, Y are correct
- Both Statements X, Y are incorrect
Answer: Answer is c
- They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
- Key objects must be immutable for the duration they are used within a HashTable.
- 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.
- Each Element in a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement
- All of the above
Answer: Answer is e
- They can be declared either static or instance members.
- Extension methods can be used to override existing instance methods
- Extension methods with the same signature for the same class may be declared in multiple namespace without causing compilation errors.
- 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
- Server validation can be used alongside with the client side validation
- All Data Posted on server, should be validated
- Client side validation typically provide faster response (Feedback) then server validation.
- All of the above
Answer: Answer is d
- More concise syntax
- The types for a Lambda Excpression may be omitted
- The body of an Anonymous method can not be an expression.
- Lambda Expressions permit deferred type inference that anonymous methods do not.
- All of the above.
Answer: Answer is a
Further Reading:
- asp:ScriptManager
- asp:AjaxManager
- asp:PageManager
- asp:ClientScriptManager
Answer: Answer is a
- Init
- PreLoad
- Load
- 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
- UserControl can directly express rendering information via markup; a Custom Server control can’t.
- UserControl does not require the use of the @Register directive; a Custom Server control does require it.
- UserControl can make use of script based validation; a Custom Server control can not.
- UserControl can represent complete compositate hierarchy; a Custom Server control can not.
Answer: Answer is d
- The actual instantiated class is dynamically created and has a base class defined in the CodeFile.
- The actual instantiated class is dynamically created and has a member representing the class defined in the CodeFile.
- The actual instantiated class is dynamically created and is a co-class of the class defined in the CodeFile.
Answer: Answer is c
Class MyClass { public event EventHandler MyEvent; }
public void A_MyEvent(object sender, MyArgs e) { }
public void A_MyEvent(object sender, EventArgs e) { }
public void A_MyEvent(MyArgs e) { }
Answer: Answer is a
static void F1(params int [] y) { } static void Sample() { int [] j = new Int32[3]; List k = new List(); // FURTHER READING GOES HERE }
- F1(j);
- F1(k);
- F1(1, 2, 3);
- 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.
- Including .Net code within the script element with the runat attribute set to server
- Including .Net code within the code element
- Including .Net code using the @code directive on the page
- Including .Net code within the execute attribute of the individual control
Answer: Answer is a
- Support is provided for the "Suite B" set of cryptographic algorithms as specified by the National Security Agency (NSA).
- Cryptography Next Generation (CNG) classes are supported on XP and Vista systems.
- The System.Security.Cryptography.AesManaged class allows custom block size, iteration counts and feedback modes to support any Rijndael based encryption.
- None of the above
Answer: Answer is d
Further Reading:
“Suite B”, CNG and System.Security.Cryptography.AesManaged not available under .net 3.5. Also, Cryptography API Next Generation(CNG) is available from Windows Vista™and onward.Useful resources,Cryptography,AesManagedclass
- ApplicationException
- DataMisalignedException
- ExecutionEngineException
- SystemException
Answer: Answer is a
Further Reading:
The exception that is thrown when a non-fatal application error occurs. Useful resources,ApplicationException
- Bringing various existing communication technologies into a unified environment.
- Cross vendor/platform communication.
- Support for asynchronous communications.
- Support for distributed applications based on technologies such as MSMQ and/or COM+
- All of the above
Answer: Answer is e
- The DataReader provides a cursor that can be used to move forward and backwards through the result.
- The DataReader provides random access capabilities on the result.
- The DataReader can provide the Schema information of the result to the application code.
Answer: Answer is c
- Propagate container related events to the child controls.
- Propagate child events up to control hierarchy
- Distribute events between peer child controls.
- 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
- <%# %>
- <%-- --%>
- <-- -->
- <# >
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
- Remove the cookie from the System.Web.UI.Page.Request.Cookies collection.
- Remove the cookie from the System.Web.UI.Page.Request.Browser.Cookies collection.
- Set the Expires property to DataTime.Now for a cookie in the Web.UI.Page.Response.Cookies
- 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
- The DataSets and DataTables objects requires continuous connection to the database
- All tables in a dataset must come from the same database
- A given instance of a DataTable can be in only one DataSet
- Content from multiple DataSets can easily be combined into a single DataSet that contains the net result of all changes
Answer: Answer is d
Statement X: DateTimeOffset values can be converted to DateTime values and vice versa.
Statement Y: DateTimeOffset does not supports arithmetical operations
- Statement X is incorrect and Statement Y is correct
- Statement X is correct and Statement Y is incorrect
- Both Statements X, Y are correct
- Both Statements X, Y are incorrect
Answer: Answer is b
Further Reading:
Useful resources, DateTimeOffsetStructure
- ServiceContract
- OperationContract
- DataContract
- MessageContract
Answer: Answer is a
- System.Web.Mail is not supported under version 3.5 of the Framework
- System.Web.Mail is deprecated under version 3.5 of the Framework, and it is officially recommended that System.Net.Mail be used.
- System.Web.Mail is the preferred solution when using IIS hosted applications.
- There are no functional differences; the items were moved to a new namespace to better reflect their applicability
Answer: Answer is b
- WebUIValidation.js
- ClientValidation.js
- AspNetValidation.js
- 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
- <exception>
- <code>
- <summary>
- All of them
Answer: Answer is d
Which of the following are common methods of supplying "Help" information to an ASP.NET application?
- Setting the ToolTip property of a control to a string containing the information.
- using the open method of the browser window object to open a new browser window and display a help related ASP.NET page.
- Using the showHelp method of the browser window object to display a topic from a compiled help file (.chm).
- All of the above
Answer: Answer is c
- Styles can be applied to all elements having the same CSS Class attribute.
- Styles can be applied to specific elements based on their ID attribute.
- Styles can be applied to elements based on their position in a hierarchy.
- Styles can be used to invoke script based code.
- All of the above.
Answer: Answer is e
- It is optimized for single processor/core operations.
- A thread which has a read lock on a resource may not acquire a write lock on the same resource.
- 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
- A specific number of requests to the application process.
- A percentage of physical memory utilized by the process.
- A specific time interval.
- A specific date and time.
- All of the above
Answer: Answer is a, c, d
- It must contain a from clause.
- It must begin with a select clause.
- 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.
- Only the UpdatePanel and any child controls go through the server lifecycle.
- The entire page always goes through the entire lifecycle.
- Only the UpdatePanel which initiated the Postback and its child controls can provide updated information.
- UpdatePanels can not be used with Master Pages.
- 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#
- The Passport SDK must be installed.
- Passport authentication requires a network path between the Client and the Microsoft Passport Server.
- Passport Authentication provides persistent authentication across sessions
Answer: Answer is b
- 1
- 25
- 250
- 100
- 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
- Expression trees are a data structure which can be initially composed using language syntax.
- Expression trees are a dynamically generated code which is executed to perform the desired function.
- Expression trees can be modified once they are created
Answer: Answer is a
- All elements in the initialize list must be of the same type.
- All elements in the initialize list must be implicitly convertible to a known type of at least one member in the initialize list.
- 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
- There are no restrictions on the items in the initializer list as the array is not declared to be a specific type
- None of the above
Answer: Answer is d
- Enabling debug information in the .NET Assembly.
- Setting the debug attribute of the compilation element to true in the web.config file.
- Enabling ASP.NET debugging in the IIS metabase.
Answer: Answer is b
- System.Web.UI.WebControls.Xml.
- System.Web.UI.WebControls.Xslt.
- System.Web.UI.WebControls.Substitution.
- System.Web.UI.WebControls.Transform
Answer: Answer is a
void Sample1(object o) { int i = (int)o; }
void Sample1(ValueType vt) { int i = (int)vt; }
enum E { Hello, World} void Sample1(System.Enum et) { E e = (E) et; }
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
- ApplicationState
- SessionState
- ViewState
- None of the above
Answer: Answer is d
Further Reading:
Information about a control created at design time stored in Script Library. Design-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
- creating an instance of System.runtime.memoryFailpoint and monitoring for an insufficient memory Exception.
- Creating an instance of system.runtime.memoryFailpoint and monitoring for an out of memory Exception.
- There is no supported application level means determine if the specific amount of memory is available
- Using static methods of System.Runtime.MemoryFailPoint and checking the return value
Answer: Answer is a
string t = @"This\Is\a\Test"; Response.Write(t);
- ThisIsaTest
- This\Is\a\Test
- It will give a compilation error: Unrecognized escape sequence
Answer: Answer is b
Further Reading:
Useful resources, String literals
- PreInit
- Init
- PreLoad
- PreRender
- 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
- C# allows non-type templateparameters.
- C# supports explicit specialization.
- C# allows the type parameter to be used as the base class for generic type.
- C# allows a generic type parameter itself to be a generic.
- C# enforces that all codes are valid for all types of parameters
Answer: Answer is e
- Creating an instance of System.Runtime.MemoryFailPoint and monitoring for an InsufficientMemoryException
- Creating an instance of System.Runtime.MemoryFailPoint and monitoring for an OutOfMemoryException
- 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
- All elements in the initializer list must be of the same type.
- 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.
- 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";
- The actual type is determined at compilation time, and has no impact on the runtime
- The actual type is determined at runtime, and late binding takes effect.
- "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
- The interval will never restart before the page postback is complete
- The timer control must be located outside of the UpdatePanel
- If the timer expiration triggers a postback while a previous postback is in progress, the first postback is canceled
- 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
- Collection Class must implement System.Collections.Generic.ICollection<T>
- Collection Class must implement System.Collections.Generic.IList<T>
- 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 classes, object and collection initializer
- Examining the UserLanguage property of current Request object.
- Examining the CurrentCulture property of the current Request object.
- 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
- WS-Addressing
- WS-MetadataExchange
- WS-Security
- WS-Atomic Transaction
- All of the above
Answer: Answer is e
+ comments + 1 comments
This blog gives very important info about .Net Thanks for sharing
.Net Online Training
Post a Comment