s

Covid-19 Update!!    We have enabled all courses through virtual classroom facility using Skype or Zoom.    Don't stop learning.    Enjoy Learning from Home.

30% Discount Python        30% Discount Webdesign        30% Discount SEO        30% Discount Angular8        Free SQL Class        Free Agile Workshop       Free HTML Sessions        Free Python Basics

Important ASP.NET Interview Questions and Answers

 ASP.NET Interview Questions & Answers

1. What is ASP.Net?

It is a framework developed by Microsoft on which we can develop new generation web sites using web forms(aspx), MVC, HTML, Javascript, CSS etc. Its successor of Microsoft Active Server Pages(ASP). Currently there is ASP.NET 4.0, which is used to develop web sites. There are various page extensions provided by Microsoft that are being used for web site development. Eg: aspx, asmx, ascx, ashx, cs, vb, html, XML etc.

2. What is the difference between Server.Transfer and Response.Redirect?

In Server.Transfer is used to transfers process from one page to the other page without making a round-trip back to the client’s browser. This gives a faster response with a little less overhead on the server. The clients URL history list or current URL Server does not update in case of Server.Transfer.

Response.Redirect is used to redirect the user’s browser to one more page or site. It completes trip back to the client where the client’s browser is redirected to the new page. The user’s browser history list is updated to reflect the new address.

3. What are the different validators in ASP.NET?

  • Required field Validator
  • Range  Validator
  • Compare Validator
  • Custom Validator
  • Regular expression Validator
  • Summary Validator

    4. Where View State is used?

    ViewState is used to retain the state of server-side objects between page post backs.

    5. How long the items in View State exists?

    They exist for the life of the current page.

    6. What is caching?

    Caching is a technique used to increase production by keeping regular accessed data or files in memory. The request for a cached file/data will be accessed from cache instead of actual location of that file.

    7. What are the different types of caching?

    ASP.NET has 3 kinds of caching:
  • Output Caching,
  • Fragment Caching,
  • Data Caching.

    8. List the events in page life cycle.

  • Page_PreInit
  • Page_Init
  • Page_InitComplete
  • age_PreLoad
  • Page_Load
  • Page_LoadComplete
  • Page_PreRender
  • Render

    9. Can we add code files of different languages in App_Code folder?

    No. The code files must be in same language to be kept in App_code folder.

    10. What are the event handlers that we can have in Global.asax file?

    The events that handlers can have in Global.asax file are of two kinds.
  • Application Events:
    Application_Start , Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute, Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
  • Session Events:
    Session_Start,Session_End

    11. What is the difference between web config and machine config?

    Web config file is specific to a web application whereas machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.

    12. What is Cross Page Posting?

    When we click submit button on a web page, the page post the data to the same page. The technique in which we post the data to different pages is called Cross Page posting. This can be achieved by setting POSTBACKURL property of the button that causes the post back. Find control method of Previous Page can be used to get the posted values on the page to which the page has been posted.

    13. What is Redirect Permanent in ASP.Net?

    Redirect Permanent performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.

    14. Explain the working of passport authentication.

    First of all it checks passport authentication cookie. If the cookie is not available then the application redirects the user to Passport Sign on page. Passport service authenticates the user details on sign on page and if valid then stores the authenticated cookie on client machine and then redirect the user to requested page.

    15. What are the advantages of Passport authentication?

  • All the websites can be accessed using single login credentials. So no need to remember login credentials for each web site.
  • Users can maintain his/ her information in a single location.

    16. What are the asp.net Security Controls?

    < asp:Login >: Provides a standard login proficiency that allows the users to enter their credentials
    < asp:LoginName>: Allows you to show the name of the logged-in user
    < asp:LoginStatus>: Displays whether the user is validate or not
    < asp:LoginView>: Provides various login views based on the selected template
    < asp:PasswordRecovery>: email the users their lost password

    17. What is boxing and unboxing?

    Boxing is assigning a value type to reference type variable.
    Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.

    18. Differentiate strong typing and weak typing

    In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.

    19. What are the components of ADO.NET?

    The components of ADO.Net are Dataset, Data Reader, Data Adaptor, Command, connection.

    20. What is the difference between ExecuteScalar and ExecuteNonQuery?

    ExecuteScalar returns output value whereas ExecuteNonQuery does not return any value but the number of rows strained by the query. ExecuteScalar used for getting a single value and ExecuteNonQuery used to execute Insert and Update statements.