Few days back I was asked by my employer to prepare some interview questions on asp.net and sqlserver for the purpose of written test. I am providing few of the interview questions with answers for the same. Let me know your ideas on the topic.
What is the interface we need to implement in order to create a HTTP Handler- IMyHandler
- IHttpHandler
- IHttpHandlerFactory
- None of the above
- IMyHandler
What is the fastest way to retrieve data from the database- Use DataTable
- Use DataAdapter
- Use Dataset
- Use DataReader
- Use DataTable
What is the correct answer among the following regarding the ViewState- It is used to Create the visibility on the Web pages
- It is used to Maintain the State of the User as long as he surf the website
- It is used to maintain the state between the subsequent requests within a page
- It is used to increase the performance of the web application
- It is used to Create the visibility on the Web pages
When does the Session_Start event in the Global.asax fire,- When a new user starts using the application
- When the user logs into the server using the Login.aspx page
- When a user requests a secured page
- When first user sends a request
- When a new user starts using the application
There is a Master page called MyApplication.master and a content page called MyContentPage.aspx. When we run the application which of the following events will take place first- Page load event in the MyApplication.master
- Page load event in the MyContentPage.aspx
- PreInit event in the MyApplication.master
- PreInit event in the MyContentPage.aspx
- Page load event in the MyApplication.master
You need to execute code conditionally, depending on whether the page is generated in response to a server control event on the same page. How would you check this programmatically?
- Page.HasControls
- Page.IsCrossPagePostBack
- Page.IsPostBack
- Page.IsCallback
- Page.HasControls
In which folder you can place the SqlServer Express Edition- App_Data
- App_Code
- App_Themes
- App_LocalResources
- App_Data
App_Code folder is used to store the class files in asp.net (Introduced in 2.0).
App_Themes is used to store the skins, themes etc (Introduced in 2.0).
App_LocalResources is used to store the resource information in asp.net.
There is a class called as MyClass in C#. When initializing the class in Using block as,MyClass obj = new MyClass();using(obj){//Some Code to follow..}
- We cannot use "using" block for the Custom classes
- MyClass must implement IDisposable interface
- The obj must be declared in try, catch block
- using block cannot be used in ASP.NET, that is only related to C#
If one has two different web form controls in application and if one wanted to
know whether the values in the above two different web form control match what
control must be used.- DataGrid Control
- CompareValidator
- TextBox Validator
- ListView Control
- DataGrid Control
Which of the following denote ways to manage state in an ASP.Net Application?- Session Objects
- Application Objects
- View State
- All of the above
- Session Objects
In ASP.NET the < authorization > section contain which of the following
elements- <deny>
- <allow>
- Both A and B
- None of the above
- <deny>
What is the easiest way to handle all the exceptions in a web application- Use try.. catch block for all the methods
- Use Error handler at the page level in each page
- Use Application level Error handler at Global.asax
- Create a section in web.config file that can handle all the errors
- Use try.. catch block for all the methods
What is AJAX?- It is a technology that enables browsers to render information faster than normal way
- It is a technology which enables javascript to do high graphics on the web pages
- It is a latest version of the Web Services
- None of the above
- It is a technology that enables browsers to render information faster than normal way
What are the datasource controls available in ASP.NET- SqlDataSource
- ObjectDataSource
- XmlDataSource
All of the Above
- SqlDataSource
How do you Cache a DataTable- By using Cache object
- By saving the DataTable to xml file and keeping in memory
- Writing the Page Output Cache attribute on the page control
- Creating a user control for a DataTable
- By using Cache object
Trace and debug classes belong to which Namespace- System.Diagnostics
- System.Reflection
- System.Data
- None of the above
- System.Diagnostics
Column mappings belongs to which namespace- System.Data
- System.Data.Common
- System.Xml
- System.Data.Relations
- System.Data