Вы находитесь на странице: 1из 6

Re: ASP.

Net interview questions and answers for freshers


What is ASP.Net? ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. What is reflection? All .NET compilers produce metadata about the t pes defined in the modules the produce. This metadata is packaged along with the module !modules in turn are packaged together in assemblies"# and can be accessed b a mechanism called reflection. The S stem.$eflection namespace contains classes that can be used to interrogate the t pes for a module%assembl . &sing reflection to access .NET metadata is ver similar to using 'T pe(ib%'T pe'nfo to access t pe librar data in )*+# and it is used for similar purposes , e.g. determining data t pe si-es for marshaling data across conte.t%process%machine boundaries. $eflection can also be used to d namicall invoke methods !see S stem% .T pe.'nvoke+ember"# or even create t pes d namicall at run, time !see S stem.$eflection.Emit.T pe/uilder". 0ow to find out what version of ASP.NET ' am using on m machine? 1)23 Response.Write(System.Environment.Version.ToString() );

0ow to comment out ASP.NET Tags? 1ASP.NET3 <%--<asp:Label i !"Label#" style!"$-%&'E(: #)#; LE*T: +p,; -.S%T%.&: absol/te; T.-: 0+p," r/nat!"server"1Label<2asp:Label1--%1

What is the Pre,)ompilation feature of ASP.NET 4.5? Previousl # in ASP.NET# the pages and the code used to be compiled d namicall and then cached so as to make the re6uests to access the page e.tremel efficient. 'n ASP.NET 4.5# the pre,compilation feature is used with which an entire site is precompiled before it is made available to users. There is a pre,defined folder structure for enabling the pre,compilation feature7 8 App9)ode7 stores classes 8 App9Themes7 stores )SS files# 'mages# etc. 8 App9:ata7 stores ;+( files# Te.t <iles# etc. 8 App9=lobal$esources7 stores all the resources at global level E.g. res. files# etc

8 App9(ocal$esources7 stores all the resources at local%Page level What is a >iewState? 'n ASP.NET# when the form is submitted the form reappears in the browser with all form values. This is because ASP .NET maintains our >iewState. >iewState is a state management techni6ue built in ASP.NET. 'ts purpose is to keep the state of controls during subse6uent postbacks b the same user. The >iewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a ?form runat@AserverAB control. 0ow to prevent a button from validating itCCs form? Set the )ause>alidation propert of the button control to <alse 0ow to access the Parameters passed in via the &$(? )all the $e6uest.Duer String method passing in the ke . The method will return the parameter value associated with that ke . 1)23 Re3/est.4/eryString5"i "6;

0ow to catch the E5E error in m web application and provide more useful information? 'n the global.asa. Application9error Event write the following code 1)23 E,7eption e, ! Server.8etLastError().8et9aseE,7eption(); i: (e,.8etType() !! typeo:(System.%..*ile&ot*o/n E,7eption)) ; 22yo/r 7o e Response.Re ire7t ("0)0-age.asp,"); < else ; 22yo/r 7o e <

what is /o.ing and &nbo.ing? /o.ing is an implicit conversion of a value t pe to the t pe obFect int i @ G4HI %% A value t pe *bFect bo. @ i %% /o.ing. A temporar bo. for the bo. reference will be created on the heap memor . JJJJJJJJJJJJJJJJJJJJJJJJJJK &nbo.ing is an e.plicit conversion from the t pe obFect to a value t pe

int i @ G4HI %% A value t pe *bFect bo. @ iI %% /o.ing int F @ !int"bo.I %% &nbo.ing Wh do ' get a blank page when ' use Server.Transfer!A0T+(Page.htmA" to transfer to a different page? Server.Transfer onl works with .asp. pages. Lou canCCt use Transfer method with 0T+( pages. What is the meaning of validate$e6uest@true in .net framework G.G? The value of validate$e6uest is set to CCtrueCC b default# which means that the framework will automaticall den submission of the CC?CC and CCBCC characters. What is the different between ?M2 MB and ?M@ MB? The ?M2 MB is used for databinding where as ?M@ MB is used to output the result of an e.pression. The e.pression inside ?M2 MB will be e.ecuted onl when ou call the pageCCs or controlCCs :ata/ind method. The e.pression inside ?M@ MB will be e.ecuted and displa ed as and when it appears in the page. )an ' use a :ata$eader to update%insert%delete a record? No. :ata$eader provides a means of reading a forward,onl stream of rows from a database. )an two different programming languages be mi.ed in a single ASP; file? No. ASP.NET uses parsers to strip the code from ASP; files and cop it to temporar files containing derived Page classes# and a given parser understands onl one language What is a (iteral )ontrol in .NET? The (iteral control is similar to the (abel control# e.cept the (iteral control does not enable ou to appl a st le to the displa ed te.t.

Re: ASP.Net interview questions and answers for freshers

0ere are few interview 6uestions. What are the events in a ASP.Net Page (ife c cle?

G. 4. H. E.

Page9'nit !Page is initiali-ed" Page9(oad !Page is loaded in the server memor " Page9Pre$ender !*nce rendering is done# controls will be displa ed in the &'" Page9&nload !Page completes its loading"

0ow do ou change a masterpage of a asp.net page d namicall ? Lou have change it in the Pre9'nit event of the page. What is the use of Smart Navigation propert ? 'tNs a feature provided b ASP.NET to prevent flickering and redrawing when the page is posted back. Where is the >iew State information stored? 'n 0T+( 0idden fields. What are the t pes of validation controls available in asp.net? G. $e6uired <ield validator 4. $ange >alidator H. )ompare >alidator E. $egular E.pression >alidator O. )ustom >alidator What are the properties should be set for a validator control? )ontrolTo>alidate and ErrorTe.t Properties should be set. What is the difference between session and application obFect? Session obFect is uni6ue for ever user and application obFect is common for all the users. E.ample# if ou login into gmail or ahoo# in the home page it displa s like AWelcome# &serNameA. 0ere Welcome is the application obFect and &serName is the Session obFect. What are the authentication t pes available in ASP.Net? G. Windows authentication 4. <orms authentication H. Passport authentication :o Session use )ookies? Les. 't uses cookies to store its Sessionid.

Re: ASP.Net interview questions and answers for freshers


Below are few .net interview questions and answers related to .net framework. Q: What is DLL hell? A decade before the application created with vb .! requires class re"istration and doin" so when an application source is chan"ed the class need to be rebuild if not it will show the dll error which is collectivel# called as dll hell. $he dotnet overcomes this because when the application is compiled it keep track on the version of ever# build and over comes the re"istr# problem. Q: What is "lobali%ation? &reatin" an application which can support multiple culture date' time etc is called "lobali%ation' which means it would have the abilit# to support multiple cultures. Q: (ow will #ou check the .net )ersion? $hese can be done in an# of the followin" a. *tart +, -un +, .netm"r +,Default Website +, /roperties +, *elect Asp.net b. -i"ht click pro0ect+, Application +, $ar"et 1ramework Q: What is manifest? $he assembl# information such as version' dependent files' resource information' and other necessar# details about the assembl# would be available in manifest. Q: (ow multiple lan"ua"es communicate with each others? $he different lan"ua"es within &L- communicates with the help of &ommon $#pe *#stem which is nothin" much the collection that has various datat#pes for mappin" purpose. 1or an instance how &2 int datat#pe should be mapped to vb.net int datat#pe. Q: What is namespace? $he classes of similar t#pes are combined to"ether into sin"le unit called namespace. .t can be referred b# usin" or imports ke#word in c2 and vb.net. Q: What is 3arba"e &ollector? $o mana"e memor# .4et &L- has "arbase collector which keeps tracks on the memor#. .t keeps checkin" for the ob0ects that doestn have reference if it finds it keeps them out and free the memor#. .t is an automatic process. -e: A*/.4et interview questions and answers for freshers
To add to the above posted interview 6uestions# We can not encr pt the following sections in the web.config7

P P P P P P P P P P

?process+odelB ?runtimeB ?mscorlibB ?startupB ?s stem.runtime.remotingB ?configProtected:ataB ?satelliteassembliesB ?cr ptograph SettingsB ?cr ptoName+appingB ?cr pto)lassesB

Вам также может понравиться