Header Ads

Top 30 ASP.NET Interview Questions And Answers – Tips For Freshers/Exp

Edit

ASP.NET Interview Questions

ASP.NET is the web developing language which is used in IT industries and ASP.NET was released in January 2002 with version 1.0 of the .NET Framework. Individuals who are preparing for ASP.NET language to make attractive web pages and looking for Top 30 ASP.NET Interview Questions And Answers, ASP.NET Interview Tips For Freshers/Exp are at correct path.

ASP.NET language is an open-source server-side web application structure build by Microsoft for web development to create dynamic web pages as well as web services. Before making a web developer in ASP.NET, candidates have to face an interview.

ASP.NET Interview:

ASP.NET Interview is just formal conversation between the Interviewee and Interviewer. Interview Question is the main problem for the candidate but we are here to help you by giving some interview question regarding ASP.NET. The ASP.NET application codes can be written in any of the following languages:
  • C#
  • Visual Basic.Net
  • Jscript
  • J#

ASP.NET Interview Questions

Have a look on ASP.NET Interview Questions and Answers to start preparation for ASP.NET Interview.

Question 1: What is ASP.Net?

Answer: 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.


Question 2: What’s the use of Response.Output.Write()?

Answer: We can write formatted output  using Response.Output.Write().

Question 3:  Can we add code files of different languages in App_Code folder?

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

Question 4: What is Protected Configuration?

Answer: It is a feature used to secure connection string information.

Question 5: In which event of page cycle is the ViewState available?

Answer: After the Init() and before the Page_Load().

Question 6: What is the difference between Server.Transfer and Response.Redirect? 

Answer: In Server.Transfer page processing transfers from one page to the other page without making a round-trip back to the client’s browser.  This provides 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 another page or site.  It performs 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.


Question 7: From which base class all Web Forms are inherited?

Answer: Page class.

Question 8: What are the different validators in ASP.NET?

Answer:

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

Question 9: Which validator control you use if you need to make sure the values in two different controls matched?

Answer: Compare Validator control.

Question 10: What is ViewState?

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

Question 11: what is boxing and unboxing?

Answer:
  • Boxing is assigning a value type to reference type variable.
  • Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.
Question 12: Differentiate strong typing and weak typing

Answer: 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.


Question 13: Where the viewstate is stored after the page postback?

Answer: ViewState is stored in a hidden field on the page at client side.  ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.

Question 14: What is the good practice to implement validations in aspx page?

Answer: Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

Question 15: Can we have multiple web config files for an asp.net application?

Answer: Yes.

Question 16: What is the difference between web config and machine config?

Answer: Web config file is specific to a web application where as 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.

Question 17: How long the items in ViewState exists?

Answer: They exist for the life of the current page.

Question 18: What are the different Session state management options available in ASP.NET?

Answer: ASP .net Interview Questions
  • In-Process
  • Out-of-Process.
In-Process stores the session in memory on the web server.
Out-of-Process Session state management stores data in an external server.  The external server may be either a SQL Server or a State Server.  All objects stored in session are required to be serializable for Out-of-Process state management.


Question 19: How you can add an event handler?

Answer: Using the Attributes property of server side control.

Question 20: What is the file extension of web service?

Answer: Web services have file extension .asmx..

Question 21: What are the components of ADO.NET?

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

Question 22: What is caching?

Answer: Caching is a technique used to increase performance by keeping frequently 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.

Question 23: What are the event handlers that we can have in Global.asax file?

Answer:
  • 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
Want to Know? How to Impress Interviewer In An Interview

Question 24: Which protocol is used to call a Web service?

Answer: HTTP Protocol

Question 25: What are the different types of caching?

Answer:
ASP.NET has 3 kinds of caching:
  • Output Caching,
  • Fragment Caching,
  • Data Caching.
Question 26: What are the advantages of Passport authentication?

AnswerAll 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.


Question 27: What are the asp.net Security Controls?

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

Question 28: List the events in page life cycle.

Answer:

Page_PreInit
Page_Init
Page_InitComplete
Page_PreLoad
Page_Load
Page_LoadComplete
Page_PreRender
Render

Question 29: Can we have a web application running without web.Config file?

 Answer: Yes

Question 30: Which data type does the RangeValidator control support?

Answer: The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.


Question 31: What is the difference between an HtmlInputCheckBox control and an HtmlInputRadioButton control?

Answer: In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.

Question 32: Is it possible to create web application with both webforms and mvc?

Answer: Yes. We have to include mvc assembly references in the web forms application to create hybrid application.

Question 33: What is Cross Page Posting?

Answer: 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 postback. Findcontrol method of PreviousPage can be used to get the posted values on the page to which the page has been posted.


Question 34: What is RedirectPermanent in ASP.Net?

 Answer: RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns 301 Moved Permanently responses.

Question 35: What is MVC?

Answer: MVC is a framework used to create web applications. The web application base builds on  Model-View-Controller pattern which separates the application logic from UI, and the input and events from the user will be controlled by the Controller.

Question 36: What are the different types of cookies in ASP.NET?

Answer:
Session Cookie – Resides on the client machine for a single session until the user does not log out.
Persistent Cookie – Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never.


Question 37: What is the difference between ExecuteScalar and ExecuteNonQuery?

Answer: ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

Question 38: Explain the working of passport authentication.

Answer: 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.


Question 39: How do you register JavaScript for webcontrols ?

Answer: We can register javascript for controls using <CONTROL -name>Attribtues.Add(scriptname,scripttext) method.

Question 40: In which event are the controls fully loaded?

Answer: Page load event.

Question 41: How we can force all the validation controls to run?

Answer: The Page.Validate() method is used to force all the validation controls to run and to perform validation.

Question 42: List all templates of the Repeater control.

Answer:

ItemTemplate
AlternatingltemTemplate
SeparatorTemplate
HeaderTemplate
FooterTemplate


Question 43: List the major built-in objects in ASP.NET?

Answer:
Application
Request
Response
Server
Session
Context
Trace

Question 44: Which namespaces are necessary to create a localized application?

Answer:
  • System.Globalization
  • System.Resources
Question 45: Mention what are the languages that .NET supports?

Answer:Languages that .NET supports are,
  • NET
  • C#
  • COBOL
  • PERL
Question 46: Mention how big is the datatype int in .NET?

Answer:Datatype int in .NET is 32 bits.

Question 47: Mention what is .Net Namespaces?

Answer: Namespaces in .NET is nothing but a way to organize .NET Framework Class Library into a logical grouping according to their usability, functionality as well as category they belong to.

Question 48: Mention what is MSIL in .NET?

Answer:
  • MSIL stands for Microsoft Intermediate Language
  • During the compile time, the source code is converted into Microsoft Intermediate Language (MSIL) by compiler
  • MSIL is a CPU-independent set of instructions that can be efficiently converted to the native code
Question 49: Mention the type of code security available in .NET?

Answer:The type of code security available in .NET are
Role based security: This authorizes the user.
Code access security: This protects system resources from unauthorized calls.

Question 50: Mention what is the difference between structures and classes in .NET?

Classes
Structures
Usually, it is used for large volume of data
It is used for smaller amounts of data
It can be inherited
It cannot be inherited
It can be NULL
It cannot be NULL like the class.
For class the keyword used is ‘class’.
For structure the keyword used is ‘struct’.
By default class member variables are private.
By default structure, members have public access.
It contains a volatile field.
It cannot contain the volatile field.
Cannot use size of operator
Can use size of operator
Fields are automatically initialized
Fields are not initialized automatically

Interview Tips for Freshers/ Experienced candidates:
  • Practice and Prepare well for Interview
  • You need to develop a Connection with the Interviewer
  • Research the Company, and Show What You Know
  • Get Ready Ahead of Time
  • Be On Time (That Means Early)
  • Try to Stay Calm
  • Follow-Up After the Interview
  • Avoid Common Interview Mistakes
  • Successfully Handle Any Type of Interview
Read Here: Interview Tips For Freshers

What Makes an Interview Successful?

It’s Social
You should express that you’d be a delighted to work with.
It’s Professional
Your appearance must be sharp, efficient, and diplomatic.
It’s Human
You need to present yourself as genuine and earnest.
The Details Matter
From your outfit to your posture, everything is information.

What Employers Look For At An Interview?

Your Appearance
Are you stylish, professional, and meticulous?
Your Tact
Do you understand appropriate professional language and etiquette?
Your Body Language
Are you someone who projects success and commands respect?
Your Confidence
Do you feel qualified for the job and able to handle the responsibilities?

Important Note:

You can get Top 30 ASP.NET Interview Questions And Answers from this page which is well prepared by the team of www.privatejobshub.in. Candidates who want to get latest updates about ASP.NET Interview Questions And Answers, University Recruitment notifications, admit cards and results, they can bookmark our web portal.

For any query regarding ASP.NET Interview Questions, comment in below given comment box. We will try to resolve your query regarding ASP.NET Interview Questions And Answers as soon as we can.

Interview Questions and Answers For

No comments

Don't Add Comment with Spam Purpose

Powered by Blogger.