Você está na página 1de 5

ASP.

NET Interview Questions This is a list of questions I have gathered and created over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far. There are some questions in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them here for easy access. 1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process. inetinfo.exe is the icrosoft II! server running, handling "!#.$%T requests among other things.&hen an "!#.$%T request is received 'usually a file with .aspx extension(, the I!"#I filter aspnet)isapi.dll takes care of it by passing the request tothe actual worker process aspnet)wp.exe. *. What s the difference between !esponse.Write"# and!esponse.$utput.Write"#% +esponse.,utput.&rite'( allows you to write formatted output. -. What &ethods are fired during the page load% Init'( . when the page is instantiated /oad'( . when the page is loaded into server memory #re+ender'( . the brief moment before the page is displayed to the user as HT / 0nload'( . when page finishes loading. 1. When during the page processing c'cle is (iewState available% "fter the Init'( and before the #age)/oad'(, or ,n/oad'( for a control. 2. What na&espace does the Web page belong in the .NET )ra&ewor* class hierarch'% !ystem.&eb.0I.#age 3. Where do 'ou store the infor&ation about the user s locale% !ystem.&eb.0I.#age.4ulture 5. What s the difference between +odebehind,-.'+ode.asp/.csandSrc,-.'+ode.asp/.cs-% 4ode6ehind is relevant to 7isual !tudio.$%T only. 8. What s a bubbled event% &hen you have a complex control, like 9ata:rid, writing an event processing

routine for each ob;ect 'cell, button, row, etc.( is quite tedious. The controls can bubble up their eventhandlers, allowing the main 9ata:rid event handler to take care of its constituents. <. Suppose 'ou want a certain ASP.NET function e/ecuted on .ouse$ver for a certain button. Where do 'ou add an event handler% "dd an ,n ouse,ver attribute to the button. %xample= btn!ubmit."ttributes."dd'>onmouseover>,>some4lient4odeHere'(?>(? 1@. What data t'pes do the !ange(alidator control support% Integer, !tring, and 9ate. 11. E/plain the differences between Server0side and +lient0side code% !erver.side code executes on the server. 4lient.side code executes in the clientAs browser. 1*. What t'pe of code "server or client# is found in a +ode01ehind class% The answer is server.side code since code.behind is executed on the server. However, during the code.behindAs execution on the server, it can render client. side code such as Bava!cript to be processed in the clients browser. 6ut ;ust to be clear, code.behind executes on the server, thus making it server.side code. 1-. Should user input data validation occur server0side or client0side% Wh'% "ll user input data validation should occur on the server at a minimum. "dditionally, client.side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user. 11. What is the difference between Server.Transfer and !esponse.!edirect% Wh' would I choose one over the other% !erver.Transfer transfers page processing from one page directly to the next page without making a round.trip back to the clientAs browser. This provides a faster response with a little less overhead on the server. !erver.Transfer does not update the clients url history list or current url. +esponse.+edirect is used to redirect the userAs browser to another page or site. This performas a trip back to the client where the clientAs browser is redirected to the new page. The userAs browser history list is updated to reflect the new address. 12. +an 'ou e/plain the difference between an AD$.NET Dataset and an AD$ !ecordset% 7alid answers are= C " 9ata!et can represent an entire relational database in memory, complete with tables, relations, and views. C " 9ata!et is designed to work without any continuing connection to the original data source. C 9ata in a 9ata!et is bulk.loaded, rather than being loaded on demand. C ThereAs no concept of cursor types in a 9ata!et.

C 9ata!ets have no current record pointer Dou can use Eor %ach loops to move through the data. C Dou can store many edits in a 9ata!et, and write them to the original data source in a single operation. C Though the 9ata!et is universal, other ob;ects in "9,.$%T come in different versions for different data sources. 13. What is the 2lobal.asa/ used for% The :lobal.asax 'including the :lobal.asax.cs file( is used to implement application and session level events. 15. What are the Application3Start and Session3Start subroutines used for% This is where you can set the specific variables for the "pplication and !ession ob;ects. 18. +an 'ou e/plain what inheritance is and an e/a&ple of when 'ou &ight use it% &hen you want to inherit 'use the functionality of( another class. %xample= &ith a base class named %mployee, a anager class could be derived from the %mployee base class. 1<. Whats an asse&bl'% "ssemblies are the building blocks of the .$%T framework. ,verview of assemblies from !9$ *@. Describe the difference between inline and code behind. Inline code written along side the html in a page. 4ode.behind is code written in a separate file and referenced by the .aspx page. *1. E/plain what a diffgra& is4 and a good use for one% The 9iff:ram is one of the two F / formats that you can use to render 9ata!et ob;ect contents to F /. " good use is reading database data to an F / file to be sent to a &eb !ervice. **. Whats .SI54 and wh' should &' developers need an appreciation of it if at all% !I/ is the icrosoft Intermediate /anguage. "ll .$%T compatible languages will get converted to !I/. !I/ also allows the .$%T Eramework to BIT compile the assembly on the installed computer. *-. Which &ethod do 'ou invo*e on the DataAdapter control to load 'our generated dataset with data% The Eill'( method.

*1. +an 'ou edit data in the !epeater control% $o, it ;ust reads the information from its data source. *2. Which te&plate &ust 'ou provide4 in order to displa' data in a !epeater control% ItemTemplate. *3. 6ow can 'ou provide an alternating color sche&e in a !epeater control% 0se the "lternatingItemTemplate. *5. What propert' &ust 'ou set4 and what &ethod &ust 'ou call in 'our code4 in order to bind the data fro& a data source to the !epeater control% Dou must set the 9ata!ource property and call the 9ata6ind method. *8. What base class do all Web )or&s inherit fro&% The #age class. *<. Na&e two properties co&&on in ever' validation control% 4ontrolTo7alidate property and Text property. -@. Which propert' on a +o&bo 1o/ do 'ou set with a colu&n na&e4 prior to setting the DataSource4 to displa' data in the co&bo bo/% 9ataTextEield property. -1. Which control would 'ou use if 'ou needed to &a*e sure the values in two different controls &atched% 4ompare7alidator control. -*. 6ow &an' classes can a single .NET D55 contain% It can contain many classes.

&eb !ervice Guestions


1. What is the transport protocol 'ou use to call a Web service% !,"# '!imple ,b;ect "ccess #rotocol( is the preferred protocol. *. True or )alse7 A Web service can onl' be written in .NET% Ealse -. What does WSD5 stand for% &eb !ervices 9escription /anguage. 1. Where on the Internet would 'ou loo* for Web services% http=HHwww.uddi.org

2. True or )alse7 To test a Web service 'ou &ust create a Windows application or Web application to consu&e this service% Ealse, the web service comes with a test page and it provides HTT#.:%T method to test.

!tate

anagement Guestions

1. What is (iewState% 7iew!tate allows the state of ob;ects 'serialiIable( to be stored in a hidden field on the page. 7iew!tate is transported to the client and back to the server, and is not stored on the server or any other external source. 7iew!tate is used the retain the state of server.side ob;ects between postabacks. *. What is the lifespan for ite&s stored in (iewState% Item stored in 7iew!tate exist for the life of the current page. This includes postbacks 'to the same page(. -. What does the -Enable(iewState- propert' do% Wh' would I want it on or off% 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 7iew!tate, which is stored as a hidden value on the page before sending the page to the clients browser. &hen the page is posted back to the server the server control is recreated with the state stored in viewstate. 1. What are the different t'pes of Session state &anage&ent options available with ASP.NET% "!#.$%T provides In.#rocess and ,ut.of.#rocess state management. In.#rocess stores the session in memory on the web server. This requires the a >sticky. server> 'or no load.balancing( so that the user is always reconnected to the same web server. ,ut.of.#rocess !ession state management stores data in an external data source. The external data source may be either a !G/ !erver or a !tate !erver service. ,ut.of.#rocess state management requires that all ob;ects stored in session are serialiIable.

Você também pode gostar