Interview Question
Interview Question
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.
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.
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