ASP.NET Interview Questions and Answers For Experienced

Q1. What is ASP.NET?


Q2. What is XHTML? Are ASP.NET Pages compliant with XHTML?






Q4. How can you detect if a viewstate has been tampered?


Q5. Can the App_Code folder contain source code files in different programming languages?



Q6. Can I deploy the application without deploying the source code on the server?



Q7. Can I use different programming languages in the same application?


Q8. How to secure your connection string information?

By using the Protected Configuration feature.

Q9. What is Cross Page Posting? How is it done?


Q10. Can you change a Master Page dynamically at runtime? How?


Q11. How to secure your configuration files to be accessed remotely by unauthorized users?


Q12. How to  configure ASP.NET applications that are running on a remote machine?


Q13. How many web.config files can I have in an application?


Q14. What is the difference between Response.Write and Response.Output.Write?



Q15. How do you apply Themes to an entire application?

By specifying the theme in the web.config file.

<pages theme=”BlueMoon” />

Q16. How do you exclude an ASP.NET page from using Themes?To remove themes from your page, use the EnableTheming attribute of the Page directive.


The ASP.NET Wizard Control.

Q18.  webservices support data reader?

No. However it does support a dataset.

Q19. Can you programmatically access IIS configuration settings?


Q20. What is caching in ASP.NET?
Caching is one of the most interesting concept and operation in ASP.NET. If you can handle it, you can run any web application by applying the caching concept depending on the requirements.Caching is for providing solutions or the results to the users depending on their request, admin needs to recreate the pages often depending on user requests…STOP!!! “A cache simply stores the output generated by a page in the memory and this saved output (cache) will serve us (users) in the future.


  • Page Caching
  • Fragment Caching
  • Data Caching

Q21. What are the major events in global.aspx?

The Global.asax file, which is derived from the HttpApplication class, maintains a pool of HttpApplication objects, and assigns them to applications as needed. The Global.asax file contains the following events:

  • Application_Init
  • Application_Disposed
  • Application_Error
  • Application_Start
  • Application_End
  • Application_BeginReques


Q23. What happens when you change the web.config file at run time?ASP.NET invalidates the existing cache and assembles a new cache. Then ASP.NET automatically restarts the application to apply the changes.

Q24. What are Cookies in ASP.NET?

Cookies are a State Management Technique that can store the values of control after a post-back. Cookies can store user-specific Information on the client’s machine like when the user last visited your site. Cookies are also known by many names, such as HTTP Cookies, Browser Cookies, Web Cookies, Session Cookies and so on. Basically cookies are a small text file sent by the web server and saved by the Web Browser on the client’s machine.

Q25. What is the code behind and Inline Code?Code Behind
Code Behind refers to the code for an ASP.NET Web page that is written in a separate class file that can have the extension of .aspx.cs or .aspx.vb depending on the language used. Here the code is compiled into a separate class from which the .aspx file derives. You can write the code in a separate .cs or .vb code file for each .aspx page. One major point of Code Behind is that the code for all the Web pages is compiled into a DLL file that allows the web pages to be hosted free from any Inline Server Code.

Inline Code
Inline Code refers to the code that is written inside an ASP.NET Web Page that has an extension of .aspx. It allows the code to be written along with the HTML source code using a <Script> tag. It’s major point is that since it’s physically in the .aspx file it’s deployed with the Web Form page whenever the Web Page is deployed.

Q26. What is the ASP.NET page life Cycle?

When a page is requested by the user from the browser, the request goes through a series of steps and many things happen in the background to produce the output or send the response back to the client. The periods between the request and response of a page is called the “Page Life Cycle”.

  • Request: Start of the life cycle (sent by the user).
  • Response: End of the life cycle (sent by the server).

There are four stages that occur during the Page Life Cycle before the HTML Response is returned to the client. Later in this article we”ll study all these stages and their sub events.

  1. Initialization :During this stage the IsPostback property is set. The page determines whether the request is a Postback (old request) or if this is the first time the page is being processed (new request). Controls on the page are available and each control’s UniqueID property is set. Now if the current request is a postback then the data has not been loaded and the value of the controls have not yet been restored from the view state.
  2. Loading :At this stage if the request is a Postback then it loads the data from the view state.
  3. Rendering : Before rendering, the View State is saved for the page and its controls. During this phase, the page calls the render method for each control, providing a text writer that writes its output to the OutputStream of the page’s Response property.
  4. Unloading :Unload is called after the page has been fully rendered, sent to the client and is ready to be discarded. At this point also the page properties such as Response and Request are unloaded.

Q27. What is the Difference between session and caching?
 The first main difference between session and caching is: a session is per-user based but caching is not per-user based, So what does that mean? Session data is stored at the user level but caching data is stored at the application level and shared by all the users. It means that it is simply session data that will be different for the various users for all the various users, session memory will be allocated differently on the server but for the caching only one memory will be allocated on the server and if one user modifies the data of the cache for all, the user data will be modified.

Q28. Explain Web Services in ASP.NET?

A web service is:

  • Language Independent.
  • Protocol Independent.
  • Platform Independent.
  • It assumes a stateless service architecture.
  • Programmable (encapsulates a task).
  • Self-describing (metadata for access and use).

Q29. Explain  the concepts of Globalization and Localization in .NET?Localization means “process of translating resources for a specific culture”, and Globalization means “process of designing applications that can adapt to different cultures”.

  • Proper Globalization: Your application should be able to Accept, Verify, and Display all global kind of data. It should well also be able to operate over this data, accordingly. We will discuss more about this “Accordingly operations over diff. culture data“.
  • Localizability and Localization: Localizability stands for clearly separating the components of culture based operations regarding the user interface, and other operations from the executable code.

.NET framework has greatly simplified the task of creating the applications targeting the clients of multiple cultures. The namespaces involved in creation of globalize, localizing applications are:

  • System.Globalization
  • System.Resources
  • System.Text

Q30. What is tracing in .NET?

Tracing helps to see the information of issues at the runtime of the application. By default Tracing is disabled.
Tracing has the following important features:

  1. We can see the execution path of the page and application using the debug statement.
  2. We can access and manipulate trace messages programmatically.
  3. We can see the most recent tracing of the data.

Tracing can be done with the following 2 types.

  1. Page Level: When the trace output is displayed on the page and for the page-level tracing we need to set the property of tracing at the page level.<%@ Page Trace=”true” Language=”C#”
  2. Application: Level: In Application-Level tracing the information is stored for each request of the application. The default number of requests to store is 10. But if you want to increase the number of requests and discard the older request and display a recent request then you need to set the property in the web.config file.<trace enabled=”true”/>
Review Date
Reviewed Item
Thank you for ASP.NET Interview Questions and Answers For Experienced
Author Rating