Online Test Knowledge of .Net Framework 4.0 Skills

Online Test Knowledge of .Net Framework 4.0 Skills

List<string> alphabets = new List<string>() { "whats", "new", "in", "aspnet" };   
var alphabetsquery = from alphabet in alphabets select alphabet.Substring(0, 1);   
foreach (var alpha in alphabetsquery)   
{     
Response.Write(alpha);   
}
  1. Wnia
  2. Whats
  3. Whatsnewinaspnet
  4. aspnetinnewwhats
Answer: Answer is a

  1. var query = from word in wordsgroup word.ToUpper() by word.Length into grorderby gr.Keyselect new { Length =3, Words = gr };
  2. var query = from word in wordswhere word.Length==3group word.ToUpper() by word.Length into grorderby gr.Keyselect new { Length = gr.Key, Words = gr };
  3. var query = words.GroupBy(w => w.Length, w => w.ToUpper()).Select(g => new { Length = g.Key, Words = g }).OrderBy(o => o.Length);
Answer: Answer is b

  1. LinqDataSource
  2. XmlDataSource
  3. AccessDataSource
  4. EntityDataSource
  5. All of the above are valid data sources
Answer: Answer is e
Further Reading:
Useful resources,Data Source Controls

int[] source = { 7, 4, 1, 3, 9, 8, 6, 7, 2, 1, 8, 15, 8, 23} and sort the elements in descending order using LINQ in Asp.Net framework 4.0. Which of the following statements can you use?
  1. var result = (from s in source orderby s select distinct s).Descending();
  2. var result = (from s in source orderby s descending select s).Distinct();
  3. var result = select distinct s from s in source sortby s descending;
  4. var result = from s in source orderby s descending group p by s select s;
Answer: Answer is b

namespace ExtensionMethods
{
public static class NumericExtensionMethods
{
  public static bool IsNumeric(this string s)
  {
    float output;
    return float.TryParse(s, out output);
  }
}
}
After adding the namespace, how will you call the ExtensionMethod on the string if your string variable is defined as:
string test="4";
  1. test.IsNumeric();
  2. ExtensionMethods.NumericExtensionMethods.IsNumeric();
  3. NumericExtensionMethods m = new NumericExtensionMethods();m.IsNumeric(test);
  4. None of the above
Answer: Answer is a

  1. It is used to add functional handles to elements or provide state information about a control
  2. It is the base class for elements that apply effects onto or around a single child element, such as Border or Viewbox
  3. It provides a set of services that can be used to extend the functionality of a common language runtime property.
  4. It is a property with the exception that its value cannot be set outside the class that declared the read-only property
Answer: Answer is b
Further Reading:
Useful resources,Decorator

  1. <%: ViewData["CurrentTime"] %>
  2. <%=ViewData["CurrentTime"] %>
  3. %ViewData["CurrentTime"] %
Answer: Answer is b
Further Reading:

  1. Readability
  2. Modifiability
  3. Category
  4. Both a and b
  5. All of the above are Localizability attributes
Answer: Answer is e
Further Reading:

  1. The response will be the first two product entries from the collection of all products after sorting the collection in descending order of Rating.
  2. The response will be the third and fourth product entries from the collection of all products after sorting the collection in ascending order of Rating.
  3. The response will be the second and third product entries from the collection of all products after sorting the collection in descending order of Rating.
Answer: Answer is b
Further Reading:

var scoreRecords = new[] { new {Name = "Alice", Score = 50},
    new {Name = "Bob" , Score = 40},
    new {Name = "Cathy", Score = 45}
  };

var scoreRecordsDict = scoreRecords.ToDictionary(sr => sr.Name);

Response.Write(scoreRecordsDict["BoB"]);
  1. { Name = Bob}
  2. { Name = Bob, Score = 40 }
  3. Name = Bob
  4. None of the above
Answer: Answer is d
Further Reading:
Useful resources, It will report error “The given key was not present in the dictionary.”

  1. SearchExpression
  2. RangeExpression
  3. OrderByExpression
  4. All of the above are valid QueryExtender filter options
Answer: Answer is d
Further Reading:
Useful resources,QueryExtender

object[] varnumbers = { null, 1.0, "two", 3, "four", 5, "six", 7.0 };

var doubles = varnumbers.OfType();

foreach (var d in doubles)
{
    Response.Write(d);
}
  1. 1, 7
  2. Null
  3. two, four, six
  4. null, 1.0, "two", 3, "four", 5, "six", 7.0
Answer: Answer is a

  1. Using the OnActionExecuted method
  2. Using the OnResultExecuted method
  3. Using the OnResultExecuting method
  4. Using the OnActionExecuting method
Answer: Answer is a

  1. HitTestResult
  2. Visual
  3. Colors
  4. Brush
Answer: Answer is b
Further Reading:
Useful resources, Visual Class

  1. It defines the common types that are supported by the languages which are compatible with the .Net framework.
  2. It represents the data types of different languages in a specific format specification
  3. It is a programming language that manages the execution of programs written in any of several supported languages, allowing them to share common object-oriented classes written in any of the languages
  4. It is a runtime environment that adds a set of services for dynamic languages to the common language runtime
Answer: Answer is d
Further Reading:
Useful resources,Dynamic Language Runtime

  1. The grouping of operations in a service
  2. The location of the operations
  3. The specific protocols and serialization formats that are used to support successful communication with the service
  4. All of the above
Answer: Answer is d
Further Reading:

  1. Server.Transfer
  2. Response.Redirect
  3. Response.RedirectPermanent
  4. Server.Execute
Answer: Answer is c

  1. It is an integer value that indicates the maximum number of times to retry delivery of a message from the application queue to the application
  2. It is an integer value that indicates the maximum number of retry cycles
  3. It is the time delay between retry cycles
Answer: Answer is a
Further Reading:
Useful resources,Poison Message

  1. $top
  2. $filter
  3. $select
  4. $expand
Answer: Answer is a
Further Reading:
Useful resources,OData System Query

  1. It is a secure and interoperable binding that is suitable for non-duplex service contracts
  2. It is a secure and interoperable binding that is suitable for duplex service contracts or communication through SOAP intermediaries
  3. It is a secure and optimized binding suitable for cross-machine communication between WCF applications
  4. It is a queued binding that is suitable for cross-machine communication between WCF applications
Answer: Answer is a
Further Reading:
Useful resources,wsHttpBinding


  1. Using System.Windows.Data namespace, you can integrate rich media, including drawings, text, and audio/video content in Windows Presentation Foundation applications
  2. It contains classes used for binding properties to data sources, data source provider classes, and data-specific implementations of collections and views
  3. It provides the types that support navigation, including navigating between windows and navigation journaling
  4. It contains classes for creating windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows operating system
Answer: Answer is b
Further Reading:

Suppose you have a GridView with paging enabled. You select the third row on page 1 and then move to page 2. Nothing is selected on page 2. When you move back to page 1, the third row should still be selected.
  1. Set the GridView DataKeyNames property
  2. Set the GridView EnablePersistedSelection property to true
  3. Set the Gridview PagerSettings-Mode property
  4. It is not possible to implement the given logic for the scenario described above
Answer: Answer is b
Further Reading:

int[]numbers={5,4,1,3,9,8,6,7,2,0};
  1. int findoddNumbers = number.Count(n => n % 2 == 1);
  2. int findoddNumbers = number.Count( n % 2 == 1);
  3. int findoddNumbers = (from number in numberswhere numbers%2==1select Count());
  4. int findoddNumbers = (from number in numberswhere number%2==1select numbers).Count();
Answer: Answer is d

  1. 5
  2. 12
  3. 20
    1. infinite
Answer: Answer is b
Further Reading:

  1. <httpModules maxRequestPathLength="260" maxQueryStringLength="2048" />
  2. <httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />
  3. None of the above
Answer: Answer is b
Further Reading:
Useful resources,What's New in ASP.NET 4

  1. Check IntPtr.Size property for a value of 8.
  2. Call the Environment.GetEnvironmentVariable method and pass in the string "Platform" as an argument. Check for a return value of "x64".
  3. Call the WOW64 emulator method Isx64() and check the boolean return value.
Answer: Answer is a
Further Reading:

  1. XAML
  2. SOAP
  3. Atom
  4. WSDL
Answer: Answer is c
Further Reading:
Useful resources,ADO.NET Data Services

  1. System.Web.Mvc
  2. System.Web.Mvc.Async
  3. System.Web.Mvc. Html
  4. System.Web.Mvc.Sync
Answer: Answer is c
Further Reading:

  1. They define, for each parameter or return type, what data is serialized to be exchanged
  2. They define which operations the client can perform on the service
  3. They define which errors are raised by the service, and how the service handles and propagates errors to its clients
Answer: Answer is a
Further Reading:
Useful resources,Data Contracts

  1. This event is first raised on the root, then on each element down the tree until the source element is reached.
  2. This event is only raised on the source element. It will have the same behavior as a plain .NET event, except that such events can still participate in mechanisms specific to routed events such as event triggers
  3. This event is first raised on the source element, then on each element up the tree until the root is reached
  4. None of the above
Answer: Answer is c
Further Reading:
Useful resources,Routed Events Overview


  1. <httpModules maxRequestPathLength="260" maxQueryStringLength="2048" />
  2. <httpRuntime maxRequestPathLength="260" maxQueryStringLength="2048" />
  3. <httpHandlers maxRequestPathLength="260" maxQueryStringLength="2048" />
  4. None of the above
Answer: Answer is b
Further Reading:
Useful resources,What's New in ASP.NET 4

  1. Using ViewData
  2. Using ViewState
  3. Using Sessions
  4. Using Cookies
Answer: Answer is a

  1. HtmlMeta meta2 = new HtmlMeta();
    meta2.Name = "description";
    meta2.Content = "add meta description";
    Page.Header.Controls.Add(HtmlMeta ); 
    
  2. Page.MetaDescription
  3. Both a and b are correct.
  4. None of the above
Answer: Answer is c
Further Reading:

  1. It is used to match the incoming requests and to map them to a controller action
  2. It is used to construct the outgoing URLs which correspond to controller actions
  3. Both a and b are correct
Answer: Answer is c
Further Reading:
Useful resources,URL Routing

var scoreRecords = new[] { new {Name = "Alice", Score = 50},
    new {Name = "Bob" , Score = 40},
    new {Name = "Cathy", Score = 45}
};

var scoreRecordsDict = scoreRecords.ToDictionary(sr =>sr.Name);

Response.Write(scoreRecordsDict["Bob"]);
  1. { Name = Bob}
  2. { Name = Bob, Score = 40 }
  3. Name = Bob
  4. None of the above
Answer: Answer is b

int[]numbers={5,4,1,3,9,8,6,7,2,0};
  1. int findoddNumbers = numbers.Count(n => n % 2 == 1);
  2. int findoddNumbers = numbers.Count( n % 2 == 1);
  3. int findoddNumbers = (from number in numbers where numbers%2==1 select Count());
  4. int findoddNumbers = (from number in numbers where number%2==1 select numbers).Count();
Answer: Answer is a, d
Share this article :

+ comments + 5 comments

February 27, 2018 at 3:06 PM

It is very good blog and useful for students and developer ,Thanks for sharing
.Net Online Training
Dot Net Online Training Bangalore
.Net Online Course


June 11, 2020 at 1:20 PM

It has been a long time since I've read anything so informative and compelling. I'm waiting for the next article from the writer. Thank you.



Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery




Post a Comment

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