asp.net interview questions and answers for fresher & experienced asp.net developer
1.What’s the difference between Response.Write() andResponse.Output.Write()?
Ans: Response.Output.Write() allows you to write formatted output.
2.What methods are fired during the page load?
Ans:
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.
3. When during the page processing cycle is ViewState available?
Ans: After the Init() and before the Page_Load(), or OnLoad() for a control.
4. What namespace does the Web page belong in the .NET Framework class hierarchy?
Ans: System.Web.UI.Page
5. Where do you store the information about the user’s locale?
Ans: System.Web.UI.Page.Culture
6. What’s a bubbled event?
Ans:
When you have a complex control, like DataGrid, writing an event processing routine for
each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their
eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
7. What data types do the RangeValidator control support?
Ans. Integer, String, and Date.
8. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Ans:
Server.Transfer transfers page processing from one page directly to the next 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. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a 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.
9. What base class do all Web Forms inherit from?
Ans: The Page class.
10. What is ViewState?
Ans.
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.
11. What does the "EnableViewState" property do? Why would I want it on or off?
Ans.
It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.
12. How to manage state in Asp.Net Web applications?
Ans.
State management is done at client side and server side
Client Side: Client Side it can achieved with the help of View state, Cookies, Query String,hidden fields and control state.
Server Side: with the help of Cache, Application,Session and Database.
Client Side: Client Side it can achieved with the help of View state, Cookies, Query String,hidden fields and control state.
Server Side: with the help of Cache, Application,Session and Database.
13. What is smart navigation?
Ans:
The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.
14. What is System.Web.Mail?
Ans.
System.Web.Mail (SWM) is the .Net namespace used to send email in .Net Framework applications. SWM contains three classes:
1. MailMessage - used for creating and manipulating the mail message contents.
2. MailAttachments - used for creating a mail attachment to be added to the mail message.
3. SmtpMail - used for sending email to the relay mail server.
1. MailMessage - used for creating and manipulating the mail message contents.
2. MailAttachments - used for creating a mail attachment to be added to the mail message.
3. SmtpMail - used for sending email to the relay mail server.
15. How many objects does ADO.Net have and what are they?
Ans.
There are 5 objects in ADO.Net.
They are Connection, Adapter, Command, Reader and Dataset.
They are Connection, Adapter, Command, Reader and Dataset.
16. How does ASP.Net page works?
Ans.
1. When a browser requests an HTML file, the server returns the file
2. When a browser requests an ASP.Net file, IIS passes the request to the ASP.Net engine on the server.
3. The ASP.Net engine reads the file, line by line, and executes the scripts in the file
4. Finally, the ASP.Net file is returned to the browser as plain HTML.
2. When a browser requests an ASP.Net file, IIS passes the request to the ASP.Net engine on the server.
3. The ASP.Net engine reads the file, line by line, and executes the scripts in the file
4. Finally, the ASP.Net file is returned to the browser as plain HTML.
17.How do you debug an ASP.Net Web application?
Ans.
Attach the aspnet_wp.exe process to the DbgClr debugger.
18. In order to get assembly info which namespace we should have import?
Ans.
System.Reflection Namespace
No comments :
Post a Comment