.NET Framework and ASP.NET Fundamentals

Test your knowledge of .NET framework concepts including C# programming fundamentals, ASP.NET web controls and page lifecycle, CLR (Common Language Runtime), and .NET framework 3.5 components. Ideal for GATE and CS students.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is not applicable in INamingContainer interface?

  1. It provides data binding.
  2. It is used to route events to its child controls.
  3. INamingContainer interface is used to create controls in the specified condition.
  4. It provides the data management.
  5. It provides the data control in a specific format.
Question 2 Multiple Choice (Single Answer)

What will be the output of the following code?

class Demo {
 static void Main(string[] args) {
  int a = 3;
  Site(ref a);
  Console.WriteLine(The value of variable is + a);
 }
 public static void Site(ref int i) {
  ++i;
 }
}
  1. 3
  2. 4
  3. 5
  4. Compilation error
  5. It will compile, but there will be no output.
Question 3 Multiple Choice (Single Answer)

Identify the output of the code:

class Site {
 static void Main(string[] args) {
  int a;
  Site(out a);
  Console.WriteLine("The value of variable is" + a);
 }
 public static void Site(out int i) {
  i = 4;
 }
}
  1. 3
  2. 4
  3. 0
  4. Will not compile due to uninitialization
  5. Will not compile due to error in out keyword syntax
Question 4 Multiple Choice (Single Answer)

What is the significance of Load method in ASP.NET controls?

  1. It causes a server control to perform final clean up.
  2. It checks the accessibility of the object.
  3. It is used to search a container for a specified control.
  4. This method is fired when the control is loaded in the page.
  5. This method is loaded when the data is retrieved.
Question 5 Multiple Choice (Single Answer)

Which of the following is not applicable for IPostBackEventHandler interface in web controls?

  1. This interface is used to transfer the events that are generated from the client side to the server.
  2. It is used to update its state or raise events on the server after examining the postback data.
  3. IPostBackEventHandler interface can transfer the postback events.
  4. This interface can control the postback event.
  5. This interface controls the procedures.
Question 6 Multiple Choice (Single Answer)

Identify the output of the code given below:

using System;
class Program {
static void Main(string[] args) {
    long[] numbers = {10.5, 3.52, 4.3456, 100.43, 3.4 };
    Console.Write(numbers[1]);
    Console.ReadLine();
   }
}
  1. 10.5
  2. 3.52
  3. 0
  4. It will not compile.
  5. Null
Question 7 Multiple Choice (Single Answer)

How does 'page rendering' work in ASP.NET page life cycle?

  1. The control properties are set using the view state and control state values.
  2. The request is postback and the related event handler is called.
  3. The view state for the page and all the controls are saved.
  4. The view state for the page and all the controls are deleted.
  5. This is the stage, in which all the page events are synchronised.
Question 8 Multiple Choice (Single Answer)

How does the 'page initialisation' stage' work in ASP.NET page life cycle?

  1. At this stage, the control properties are set using the view state and control state values.
  2. The controls are set by assigning a unique ID.
  3. The rendered page is send to the client.
  4. At this stage, the view controls and pages are saved.
  5. It controls the execution state.
Question 9 Multiple Choice (Single Answer)

Predict the correct output of the code given below:

using System;
class Program {
 static void Main(string[] args) {
  Byte[] numbers = {
   10,
   20,
   30,
   40
  };
  Console.Write(numbers[1]);
  Console.ReadLine();
 }
}
  1. 10
  2. 20
  3. 30
  4. 0
  5. Compilation error
Question 10 Multiple Choice (Single Answer)

Which of the following is incorrect about the components in the .NET framework?

  1. CLR, .NET framework class library and windows forms are the components of .NET framework 3.5.
  2. Windows Presentation Foundation and Windows Communication Foundation (WCF) are not included in the components of .NET framework.
  3. The CLS (Common Language Specification) component provides the language integration.
  4. CTS provides data types based on the specification.
  5. These components include base class libraries too.
Question 11 Multiple Choice (Single Answer)

Identify the output of the code given below:

using System;
class Demo1 {
 public void X() {
  Console.WriteLine("2");
 }
}
class Demo2: Demo1 {
 public new void X() {
  Console.WriteLine("4");
 }
}
class Test {
 static void Main(string[] args) {
  Demo1 s = new Demo1();
  s.X();
  Demo1 a = new Demo2();
  a.X();
 }
}
  1. 2
    2
  2. 2
    4
  3. 4
    4
  4. Null
  5. It will not compile.
Question 12 Multiple Choice (Single Answer)

What is the role of Windows CardSpace in .NET framework 3.5?

  1. This component provides safety of accessing resources and sharing personal information on the internet.
  2. It is used for data querying capabilities to .Net languages using a syntax which is similar to the tradition query language SQL.
  3. It determines the separation between the user interface and the business logic.
  4. This component is responsible for the storage of data.
  5. It is responsible for the data retrieval.
Question 13 Multiple Choice (Single Answer)

Which of the following is the incorrect statement about ASP.NET server controls?

  1. Data source controls provide data binding to different data sources.
  2. ASP.NET provides graphical user controls.
  3. Master pages come under the category of server controls.
  4. There are no custom controls present in ASP.NET server controls.
  5. These controls have user interface modules.
Question 14 Multiple Choice (Single Answer)

Which of the following is incorrect about the CLR (Common Language Runtime) in .NET framework?

  1. CLR includes the CTS (Common Type System).
  2. CLR is responsible for memory management.
  3. CLR is the base layer in .NET framework.
  4. CLR provides the monitoring of the complete life cycle of the object.
  5. CLR executes the .dll file.
Question 15 Multiple Choice (Single Answer)

Identify the correct output of the code given below:

using System;
class welcome {
 static void Main(string[] args) {
  String s =  "Welcome";;
  Object s3 = s.Clone();
  Console.WriteLine( "" + s3);
 }
}
  1. Compilation error due to invalid cast of Object to String.
  2. Compilation error due to invalid cast of String to Object.
  3. Welcome
  4. Null
  5. Exception is possible.