- Views: 5
- Report Article
- Articles
- Reference & Education
- Online Education
Top 20 ASP.NET Interview Questions and Answers
Posted: Oct 13, 2019
Top 20 ASP.NET Interview Questions and Answers
ASP.NET is one of the most widely used frameworks to develop windows applications by Microsoft in which you can develop new generation websites by using web forms (Aspx), HTML, MVC, Javascript, CSS, etc.
Here is the list of top 20 ASP.NET Interview Questions and Answers:
What is ASP.NET?
Ans: ASP.NET is a.NET framework developed by Microsoft through which a programmer or developer can develop new generation website. It is the successor of Microsoft
Active Server Pages (ASP). There are several page extensions provided by Microsoft for using it in website development, such as :aspx, ashx, ascx, asmx, vb, cs, XML, html etc.
2. Difference between ASP.NET MVC and ASP.NET Web Forms?
Ans: ASP.NET Web Forms mainly use Page controller pattern for approaching rendering layout. In this case, every page has its own controller and code behind the file process the whole request. Whereas, the Asp.net Mvc uses Front controller approach where a common controller is being used for all the pages to process the requests.
What is the Postback concept in ASP.NET?
Ans: Post back is a request which has been sent from client to server from the same page where user is already working. ASP.NET has been introduced to post an HTTP POST request mechanism back to the same page. It is mainly posting a complete page back to the server on the same page. Thus, the whole page has been refreshed.
What is the use of Response.Output.Write?
Ans: A programmer can write formatted output using Response.Output.Write.
What is the difference between Response.Redirect and Server.Transfer?
Ans: Response.Redirect is mainly used to redirect the browser of the user to another site or another page. It performs trip back to the client where the client’s browser has been redirected to the new page. The browser history list of the user is updated to reflect the new address.
In Server.Transfer, page processing transfers from one page to another page on the website without making the Roundtrip back to the client’s browser. It will ultimately provide a faster response with a little less overhead on the server. However, the URL history list or current URL server of the client does not update in such case.
6. Name the list of different validators in ASP.NET?
Ans:
- Required Field Vaidator
- Compare Validator
- Range Validator
- Regular Expression Validator
- Custom Validator
- Summary Validator
Briefly explain the Page Life Cycle of ASP.NET?
Ans: During the life cycle, ASP.NET passes through a series of steps.
Initialization: In this stage, it controls their Init event. Variable and other objects are initializes for the complete lifecycle of request.
LoadViewState: It is a post backstage where it loads the view state of the controls to enable its view state property.
LoadPostBackData: It is a post back stage which loads the data that are being posted for the controls and then again update them.
Load: Page and all Controls raise their Load events in this stage. All the controls are initialized and loaded till this stage.
RaisePostBackEvent: It is raise against a button click event. Programmer can put code here to perform few activities.
SaveViewState: Controls State which is saved in this stage before rendering HTML.
Render: Here, HTML is generated for the page.
Dispose: All objects associated with request.
Name the Base Class from which Web Forms are inherited?
Ans: Page Class
What are the different Session State Management options in ASP.NET?
Ans:
- In-Process
- Out-Process.
What is Caching?
Ans: It is a technique which is used to increase the performance by keeping the data or files in memory. The request of cached data/file will be accessed from cache instead of the actual location of that file.
What are the different types of Caching in ASP.NET?
Ans:
Output Caching
Fragment Caching
Data Caching
Can we have a web application running without Web.Config file?
Ans: Yes
Which protocol is being used to call a web service?
Ans: HTTP Protocol
Can we have multiple Web Config files for application of ASP.NET?
Ans: Yes.
How do your register JavaScript for Webcontrols?
Ans: By using Attributes.Add(scriptname,scripttext) method.
Can we add code file of different language in App_Code Folder?
Ans: No. The code files must be in the same language to keep it in App_Code Folder.
What are the types of Authentication in ASP.NET?
Ans: Three types of Authentication –
- Windows Authentication
- Forms Authentication
- Passport Authentication
What is Protected Configuration?
Ans: It is used to secure connection string information.
Difference between Web Config and Machine Config?
Ans: Web config is specific for the web application whereas machine config is specific for the machine or server. Multiple web config files can be present into an application but only one machine config file can be there on a server
What are the major built-in objects in ASP.NET?
Ans:
- Application
- Request
- Response
- Session
- Server
- Context
- Trace
Hello Guys, this is sourav kumar, i am blogger and love to share article. i am working with loan dealing company, Who offer the best loan services for you.
Thanks for sharing this wonderful content. its very interesting. Many blogs I see these days do not really provide anything that attracts others but the way you have clearly explained everything it's really fantastic. There are lots of posts But your way of Writing is so Good & Knowledgeable. keep posting such useful information and have a look at "React training in hyderabad