<!–[if !mso]> <! st1\:*{behavior:url(#ieooui) } –>
Taken from TechSvr Blog
Is it possible to debug JavaScript 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.
How many ways can we maintain the state of a page?
Ans. 1. Client Side – Query string, hidden variables, ViewState, cookies
2. Server side – application, cache, context, session, database
What is the use of Singleton pattern?
Ans. A Singleton pattern is used to make sure that only one instance of a class exists.
What is an .ashx file?
Ans. It is a web handler file that produces output to be consumed by an xml consumer client (rather than a browser).
What is encapsulation?
Ans. Encapsulation is the process of hiding all of the details of an object that do not contribute to its essential characteristics.
What is a Delegate?
Ans. A delegate is a strongly typed function pointer object that encapsulates a reference to a method, and so the function that needs to be invoked may be called at runtime.
What is the base class of all web forms?
Ans. System.Web.UI.Page
How to add a client side event to a server control?
Ans. BtnSubmit.Attributes.Add(“onclick”,”javascript:fnSomeFunctionInJavascript()”);
How to register a client side script from code-behind?
Ans. Use the Page.RegisterClientScriptBlock method in the server side code to register the script that may be built using a StringBuilder.
Can we put a break statement in a finally block?
Ans. The finally block cannot have the break, continue, return and goto statements.
How to instruct the garbage collector to collect unreferenced data?
Ans. We may call the garbage collector to collect unreferenced data by executing the System.GC.Collect() method.
What are Partial Classes in Asp.Net 2.0?
Ans. In .NET 2.0, a class definition may be split into multiple physical files but partial classes do not make any difference to the compiler as during compile time, the compiler groups all the partial classes and treats them as a single class.
What is Boxing and Unboxing?
Ans. Boxing is the process where any value type can be implicitly converted to a reference type object while Unboxing is the opposite of boxing process where the reference type is converted to a value type.
What does AddressOf in VB.NET operator do?
Ans. The AddressOf operator is used in VB.NET to create a delegate object to a method in order to point to it.
What is XmlHttpRequest in Ajax?
Ans. It is an object in JavaScript that allows the browser to communicate to a web server asynchronously without making a postback.
What does the virtual keyword in C# mean?
Ans. The virtual keyword signifies that the method and property may be overridden.
How to create a new unique ID for a control?
Ans. ControlName.ID = “ControlName” + Guid.NewGuid().ToString(); //Make use of the Guid class
What is the use of the dispose() method in .NET?
Ans. The Dispose method in .NET belongs to IDisposable interface and it is best used to release unmanaged objects like File objects, Windows API objects, Database connection objects, COM objects etc from the memory. Its performance is better than the finalize() method.
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.
Controls in order of has performance, DataGrid, Repeater, DataList?
Ans. Repeater, Datalist, DataGrid.
Is it possible to perform forms authentication with cookies disabled on a browser?
Ans. No, it is not possible.
What is difference between dataset and datareader in ADO.NET?
Ans. A DataReader provides a forward-only and read-only access to data, while the DataSet object can carry more than one table and at the same time hold the relationships between the tables. Also note that a DataReader is used in a connected architecture whereas a Dataset is used in a disconnected architecture.