1.What are server controls?
Ans : ASP.NET server controls are components that run on the server and encapsulate user-interface and other related functionality. They are used in ASP.NET pages and in ASP.NET code-behind classes.
2.What are Sealed Classes in C#?
Ans : The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class) .
3.What is the difference between Array and Arraylist?
Ans : As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.
4.What is Jagged Arrays?
Ans : A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an “array-of-arrays.”
5.Which method is used to redirect the user to another page without performing a round trip to the client?
Ans : Server.Transfer method.
6.Is it possible to debug java-script in .NET IDE? If yes, how?
Ans : Yes, simply write “debugger” statement at the point where the breakpoint needs to be set within the javascript code and also enable javascript debugging in the browser property settings.
7.How many ways can we maintain the state of a page?
Ans : Client Side – Query string, hidden variables, viewstate, cookies
Server side – application , cache, context, session, database.
8.Will the finally block be executed if an exception has not occurred?
Ans : Yes it will execute.
9.What is the base class of all web forms?
Ans : System.Web.UI.Page .
10.Can we force the garbage collector to run?
Ans : Yes, using the System.GC.Collect(), the garbage collector is forced to run in case required to do so.
11.What does the virtual keyword in C# mean?
Ans : The virtual keyword signifies that the method and property may be overridden.
12.Whats the difference between web.config and app.config?
Ans : Web.config is used for web based asp.net applications whereas app.config is used for windows based applications.
13.What is the difference between a session object and an application object?
Ans : A session object can persist information between HTTP requests for a particular user, whereas an application object can be used globally for all the users.
14.Is it possible to perform forms authentication with cookies disabled on a browser?
Ans : No, it is not possible.
15.Which control has a faster performance, Repeater or Datalist?
Ans : Repeater.
16.What technique is used to figure out that the page request is a postback?
Ans : The IsPostBack property of the page object may be used to check whether the page request is a postback or not. IsPostBack property is of the type Boolean.
17.How can we force a thread to sleep for an infinite period?
Ans : Call Thread.Sleep(Timeout.Infinite) .
18.What’s the difference between Response.Write() andResponse.Output.Write()?
Ans : Response.Output.Write() allows you to write formatted output.
19.Describe the difference between inline and code behind.
Ans : 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.
20.What is the lifespan for items stored in ViewState?
Ans : Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).
21.What is PostBack & Callback?
Ans : One technique that current ASP.NET 1.0/1.1 developers use to overcome this postback problem is to use the Microsoft XMLHTTP ActiveX object to send requests to server-side methods from client-side JavaScript. In ASP.NET 2.0, this process has been simplified and encapsulated within the function known as the Callback Manager. The ASP.NET 2.0 Callback Manager uses XMLHTTP behind the scenes to encapsulate the complexities in sending data to and from the servers and clients. And so, in order for the Callback Manager to work, you need a web browser that supports XMLHTTP. Microsoft Internet Explorer is, obviously, one of them.
22.What is singlecall and singleton ?
Ans : Differneces between Single Call &a
mp; Singleton. Single Call objects service one and only one request coming in. SingleCall objects are useful in scenarios where the objects are required to do afinite amount of work. Single Call objects areusually not required to store state information, and they cannot hold state information between method calls. However, SingleCall objects can be configured in aload-balanced fashion.
Singleton objects are those objects that service multiple clients and hence share data by storing state information between client invocations. They are useful in cases in which data needs tobe shared explicitly between clients and also in which the overhead of creating and maintaining objects is substantial.
23.What is Machine.config File ?
Ans : As web.config file is used to configure one asp .net web application, same way Machine.config file is usedto configure application according to a particular machine. That is, configuration done in machine.configfile is affected on any application that runs on a particular machine. Usually, this file is not alteredand only web.config is used which configuring applications.
24.What debugging tools come with the .NET SDK?
Ans : 1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch.
2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR.
25.What does assert() method do?
Ans : In debug compilation, assert takes in a Boolean condition as a parameter, and shows the errordialog if the condition is false. The program proceeds without any interruption if the conditionis true.