Vous êtes sur la page 1sur 34

300asp.

netinterviewquestionsandanswers
ASP.NETinterviewquestionsMay25,2014at03:36PMbyRajSingh

DescribestatemanagementinASP.NET.
Statemanagementisatechniquetomanageastateofanobjectondifferentrequest.
TheHTTPprotocolisthefundamentalprotocoloftheWorldWideWeb.HTTPisastatelessprotocolmeanseveryrequestisfrom
newuserwithrespecttowebserver.HTTPprotocoldoesnotprovideyouwithanymethodofdeterminingwhetheranytworequests
aremadebythesameperson.
Maintainingstateisimportantinanywebapplication.TherearetwotypesofstatemanagementsysteminASP.NET.
Clientsidestatemanagement
Serversidestatemanagement

Explainclientsidestatemanagementsystem.
ASP.NETprovidesseveraltechniquesforstoringstateinformationontheclient.Theseincludethefollowing:
viewstateASP.NETusesviewstatetotrackvaluesincontrolsbetweenpagerequests.Itworkswithinthepageonly.Youcannot
useviewstatevalueinnextpage.
controlstate:Youcanpersistinformationaboutacontrolthatisnotpartoftheviewstate.Ifviewstateisdisabledforacontrolor
thepage,thecontrolstatewillstillwork.
hiddenfields:Itstoresdatawithoutdisplayingthatcontrolanddatatotheusersbrowser.Thisdataispresentedbacktothe
serverandisavailablewhentheformisprocessed.Hiddenfieldsdataisavailablewithinthepageonly(pagescopeddata).
Cookies:Cookiesaresmallpieceofinformationthatservercreatesonthebrowser.Cookiesstoreavalueintheusersbrowser
thatthebrowsersendswitheverypagerequesttothewebserver.
Querystrings:Inquerystrings,valuesarestoredattheendoftheURL.Thesevaluesarevisibletotheuserthroughhisorher
browsersaddressbar.Querystringsarenotsecure.Youshouldnotsendsecretinformationthroughthequerystring.

Explainserversidestatemanagementsystem.
Thefollowingobjectsareusedtostoretheinformationontheserver:

ApplicationState:
ThisobjectstoresthedatathatisaccessibletoallpagesinagivenWebapplication.TheApplicationobjectcontainsglobal
variablesforyourASP.NETapplication.
CacheObject:Cachingistheprocessofstoringdatathatisusedfrequentlybytheuser.Cachingincreasesyourapplications
performance,scalability,andavailability.Youcancatchthedataontheserverorclient.
SessionState:Sessionobjectstoresuserspecificdatabetweenindividualrequests.Thisobjectissameasapplicationobjectbut
itstoresthedataaboutparticularuser.

Explaincookieswithexample.
Acookieisasmallamountofdatathatservercreatesontheclient.Whenawebservercreatesacookie,anadditionalHTTP
headerissenttothebrowserwhenapageisservedtothebrowser.TheHTTPheaderlookslikethis:
SetCookie:message=Hello.Afteracookiehasbeencreatedonabrowser,wheneverthebrowserrequestsapagefromthesame
applicationinthefuture,thebrowsersendsaheaderthatlookslikethis:
Cookie:message=Hello
Cookieislittlebitoftextinformation.Youcanstoreonlystringvalueswhenusingacookie.Therearetwotypesofcookies:
Sessioncookies
Persistentcookies.
Asessioncookieexistsonlyinmemory.Ifauserclosesthewebbrowser,thesessioncookiedeletepermanently.
Apersistentcookie,ontheotherhand,canavailableformonthsorevenyears.Whenyoucreateapersistentcookie,thecookieis
storedpermanentlybytheusersbrowserontheuserscomputer.
Creatingcookie
protectedvoidbtnAdd_Click(objectsender,EventArgse)
{
Response.Cookies[message].Value=txtMsgCookie.Text
}
//HeretxtMsgCookieistheIDofTextBox.

//cookienamesarecasesensitive.CookienamedmessageisdifferentfromsettingacookienamedMessage.
Theaboveexamplecreatesasessioncookie.Thecookiedisappearswhenyoucloseyourwebbrowser.Ifyouwanttocreatea
persistentcookie,thenyouneedtospecifyanexpirationdateforthecookie.
Response.Cookies[message].Expires=DateTime.Now.AddYears(1)
ReadingCookies
voidPage_Load()
{
if(Request.Cookies[message]!=null)
lblCookieValue.Text=Request.Cookies[message].Value
}
//HerelblCookieValueistheIDofLabelControl.

Describethedisadvantageofcookies.
Cookiecanstoreonlystringvalue.
Cookiesarebrowserdependent.
Cookiesarenotsecure.
Cookiescanstoresmallamountofdata.

WhatisSessionobject?Describeindetail.
HTTPisastatelessprotocolitcan'tholdtheuserinformationonwebpage.Ifuserinsertssomeinformation,andmovetothenext
page,thatdatawillbelostanduserwouldnotabletoretrievetheinformation.Foraccessingthatinformationwehavetostore
information.Sessionprovidesthatfacilitytostoreinformationonservermemory.Itcansupportanytypeofobjecttostore.For
everyuserSessiondatastoreseparatelymeanssessionisuserspecific.

StoringthedatainSessionobject.
Session[message]=HelloWorld!
RetrevingthedatafromSessionobject.
Label1.Text=Session[message].ToString()

WhataretheAdvantagesandDisadvantagesofSession?
Followingarethebasicadvantagesanddisadvantagesofusingsession.
Advantages:
Itstoresuserstatesanddatatoallovertheapplication.
Easymechanismtoimplementandwecanstoreanykindofobject.
Storeseveryuserdataseparately.
Sessionissecureandtransparentfromuserbecausesessionobjectisstoredontheserver.
Disadvantages:
Performanceoverheadincaseoflargenumberofuser,becauseofsessiondatastoredinservermemory.

OverheadinvolvedinserializingandDeSerializingsessionData.BecauseIncaseofStateServerandSQLServersessionmode
weneedtoserializetheobjectbeforestore.

DescribetheMasterPage.
MasterpagesinASP.NETworksasatemplatethatyoucanreferencethispageinallothercontentpages.Masterpagesenable
youtodefinethelookandfeelofallthepagesinyoursiteinasinglelocation.Ifyouhavedonechangesinmasterpage,thenthe
changeswillreflectinallthewebpagesthatreferencemasterpages.Whenusersrequestthecontentpages,theymergewiththe
masterpagetoproduceoutputthatcombinesthelayoutofthemasterpagewiththecontentfromthecontentpage.

ContentPlaceHoldercontrolisavailableonlyonmasterpage.YoucanusemorethanoneContentPlaceHoldercontrolinmaster
page.Tocreateregionsthatcontentpagescanfillin,youneedtodefineContentPlaceHoldercontrolsinmasterpageasfollows:
<asp:ContentPlaceHolderID=ContentPlaceHolder1runat=server>
</asp:ContentPlaceHolder>

ThepagespecificcontentisthenputinsideaContentcontrolthatpointstotherelevant
ContentPlaceHolder:
<asp:ContentID=Content1ContentPlaceHolderID=ContentPlaceHolder1Runat=Server>
</asp:Content>
NotethattheContentPlaceHolderIDattributeoftheContentcontrolpointstotheContentPlaceHolderthatisdefinedinthemaster
page.
Themasterpageisidentifiedbyaspecial@Masterdirectivethatreplacesthe@Pagedirectivethatisusedforordinary.aspx
pages.
<%@MasterLanguage="C#"AutoEventWireup="true"CodeFile="CareerRide.master.cs"Inherits="CareerRide"%>

HowyoucanaccessthePropertiesandControlsofMasterPagesfromcontentpages?
YoucanaccessthePropertiesandControlsofMasterPagesfromcontentpages.InmanysituationsyouneedUsersNamein
differentcontentpages.Youcansetthisvalueinsidethemasterpageandthenmakeitavailabletocontentpagesasapropertyof
themasterpage.
Wewillfollowthefollowingstepstoreferencethepropertiesofmasterpagefromcontentpages.
Step:1
Createapropertyinthemasterpagecodebehindfile.
publicStringUserName
{
get{
return(String)Session["Name"]
}
set{
Session["Name"]=value
}
}
Step:2

Addthe@MasterTypedeclarationtothe.aspxcontentpagetoreferencemasterpropertiesinacontentpage.Thisdeclarationis
addedjustbelowthe@Pagedeclarationasfollows:
<%@PageTitle="TEST"Language="C#"MasterPageFile="~/CareerRide.master"AutoEventWireup="true"
CodeFile="CareerRideWelcome.aspx.cs"Inherits="CareerRideWelcome"%>
<%@MasterTypeVirtualPath="~/CareerRide.master"%>
Step:3
Onceyouaddthe@MasterTypedeclaration,youcanreferencepropertiesinthemasterpageusingtheMasterclass.Forexample
takealabelcontrolthatidisID="Label1"
Label1.Text=Master.UserName
ForreferencingcontrolsintheMasterPagewewillwritethefollowingcode.
ContentPageCode.
protectedvoidButton1_Click(objectsender,EventArgse)
{
TextBoxtxtName=(TextBox)Master.FindControl("TextBox1")
Label1.Text=txtName.Text
}
Toreferencecontrolsinamasterpage,callMaster.FindControlfromthecontentpage.

WhatarethedifferentmethodofnavigationinASP.NET?
Pagenavigationmeansmovingfromonepagetoanotherpageinyourwebsiteandanother.Therearemanywaystonavigatefrom
onepagetoanotherinASP.NET.
Clientsidenavigation
Crosspageposting
Clientsidebrowserredirect
ClientSideNavigation
Clientsidenavigation:

ClientsidenavigationallowstheusertonavigatefromonepagetoanotherbyusingclientsidecodeorHTML.Itrequestsanew
Webpageinresponsetoaclientsideevent,suchasclickingahyperlinkorexecutingJavaScriptaspartofabuttonclick.
Example:
DragaHyperLinkcontrolontheformandsettheNavigateUrlpropertytothedesireddestinationpage.
HyperLinkControl:Source
<asp:HyperLinkID="HyperLink1"runat="server"NavigateUrl="~/Welcome.aspx">TakeatestfromCareerRide
</asp:HyperLink>
Supposethat,thiscontrolisplacedonaWebpagecalledCareerRide.aspx,andtheHyperLinkcontrolisclicked,thebrowser
simplyrequeststheWelcome.aspxpage.
SecondmethodofclientsidenavigationisthroughJavaScript.
Example:
TakeanHTMLbuttoncontrolonwebpage.FollowingistheHTMLcodefortheinputbutton.
<inputid="Button1"type="button"value="Gotonextpage"onclick="returnButton1_onclick()"/>
WhentheButton1isclicked,theclientsidemethod,Button1_onclickwillbecalled.TheJavaScriptsourcefortheButton1_onclick
methodisasfollows:
<scriptlanguage="javascript"type="text/javascript">
functionButton1_onclick()
{
document.location="NavigateTest2.aspx"
}
</script>
Crosspageposting:
Example:
Supposethatwehavetwopages,thefirstpageisFirstPage.aspxandSecondpageisSecondPage.aspx.TheFirstPagehasa

ButtonandTextBoxcontrolanditsIDisButton1andTextBox1respectively.AButtoncontrolhasitsPostBackUrlproperty.Set
thispropertyto~/SecondPage.aspx.WhentheuserclicksonButton,thedatawillsendtoSecondPageforprocessing.Thecode
forSecondPageisasfollows:
protectedvoidPage_Load(objectsender,EventArgse)
{
if(Page.PreviousPage==null)
{
Label1.Text="Nopreviouspageinpost"
}
else
{
Label1.Text=((TextBox)PreviousPage.FindControl("TextBox1")).Text
}
}
ThesecondpagecontainsaLabelcontrolanditsIDisLabel1.
ThepagethatreceivesthePostBackreceivestheposteddatafromthefirstpageforprocessing.Wecanconsiderthispageasthe
processingpage.Theprocessingpageoftenneedstoaccessdatathatwascontainedinsidetheinitialpagethatcollectedthedata
anddeliveredthePostBack.ThepreviouspagesdataisavailableinsidethePage.PreviousPageproperty.Thispropertyisonly
setifacrosspagepostoccurs.
Clientsidebrowserredirect:
ThePage.ResponseobjectcontainstheRedirectmethodthatcanbeusedinyourserversidecodetoinstructthebrowserto
initiatearequestforanotherWebpage.TheredirectisnotaPostBack.ItissimilartotheuserclickingahyperlinkonaWebpage.
Example:
protectedvoidButton1_Click(objectsender,EventArgse)
{
Response.Redirect("Welcome.aspx")
}
Inclientsidebrowserredirectmethodanextraroundtriptotheserverishappened.

Serversidetransfer:
InthistechniqueServer.Transfermethodisused.TheTransfermethodtransferstheentirecontextofaWebpageovertoanother
page.Thepagethatreceivesthetransfergeneratestheresponsebacktotheusersbrowser.InthismechanismtheusersInternet
addressinhisbrowserdoesnotshowtheresultofthetransfer.Theusersaddressbarstillreflectsthenameoftheoriginally
requestedpage.
protectedvoidButton1_Click(objectsender,EventArgse)
{
Server.Transfer("MyPage.aspx",false)
}
TheTransfermethodhasanoverloadthatacceptsaBooleanparametercalledpreserveForm.Yousetthisparametertoindicateif
youwanttokeeptheformandquerystringdata.
ASP.NETinterviewquestionsApril16,2013at01:36PMbyKshipraSingh

1.WhatdoestheOrientationpropertydoinaMenucontrol?
OrientationpropertyoftheMenucontrolsetsthedisplayofmenuonaWebpagetoverticalorhorizontal.
Originallytheorientationissettovertical.

2.Differentiatebetween:
a.)ClientsideandserversidevalidationsinWebpages.
Clientsidevalidationshappendsattheclient'ssidewiththehelpofJavaScriptandVBScript.ThishappensbeforetheWebpage
issenttotheserver.
Serversidevalidationsoccursplaceattheserverside.

b.)Authenticationandauthorization.
Authenticationistheprocessofverifyngtheidentityofauserusingsomecredentialslikeusernameandpasswordwhile
authorizationdeterminesthepartsofthesystemtowhichaparticularidentityhasaccess.
Authenticationisrequiredbeforeauthorization.
Fore.g.Ifanemployeeauthenticateshimselfwithhiscredentialsonasystem,authorizationwilldetermineifhehasthecontrol

overjustpublishingthecontentoralsoeditingit.

3.a.)Whatdoesthe.WebPartfiledo?
ItexplainsthesettingsofaWebPartscontrolthatcanbeincludedtoaspecifiedzoneonaWebpage.

b.)Howwouldyouenableimpersonationintheweb.configfile?
Inordertoenabletheimpersonationintheweb.confingfile,takethefollowingsteps:
Includethe<identity>elementintheweb.configfile.
Settheimpersonateattributetotrueasshownbelow:
<identityimpersonate="true"/>

4.a.)Differentiatebetween
a.)Filebaseddependencyandkeybaseddependency.
Infilebaseddependency,thedependencyisonafilesavedinadiskwhileinkeybaseddependency,youdependonanother
cacheditem.

b.)Globalizationandlocalization.
GlobalizationisatechniquetoidentifythepartofaWebapplicationthatisdifferentfordifferentlanguagesandseparateitoutfrom
thewebapplicationwhileinlocalizationyoutrytoconfigureaWebapplicationsothatitcanbesupportedforaspecificlanguageor
locale.

5.a.)Differentiatebetweenapagethemeandaglobaltheme?
Pagethemeappliestoaparticularwebpagesoftheproject.ItisstoredinsideasubfolderoftheApp_Themesfolder.
Globalthemeappliestoallthewebapplicationsonthewebserver.ItisstoredinsidetheThemesfolderonaWebserver.

b.)WhatareWebservercontrolsinASP.NET?
ThesearetheobjectsonASP.NETpagesthatrunwhentheWebpageisrequested.
SomeoftheseWebservercontrols,likebuttonandtextbox,aresimilartotheHTMLcontrols.
Somecontrolsexhibitcomplexbehaviorlikethecontrolsusedtoconnecttodatasourcesanddisplaydata.

6.a.)DifferentiatebetweenaHyperLinkcontrolandaLinkButtoncontrol.

AHyperLinkcontroldoesnothavetheClickandCommandeventswhiletheLinkButtoncontrolhasthem,whichcanbehandledin
thecodebehindfileoftheWebpage.

b.)HowdoCookieswork?Giveanexampleoftheirabuse.
Theserverdirectsthebrowsertoputsomefilesinacookie.Allthecookiesarethensentforthedomainineachrequest.
Anexampleofcookieabusecouldbeacasewherealargecookieisstoredaffectingthenetworktraffic.

7.a.)WhatareCustomUserControlsinASP.NET?
Thesearethecontrolsdefinedbydevelopersandworksimilarttootherwebservercontrols.
Theyareamixtureofcustombehaviorandpredefinedbehavior.

b.)WhatisRolebasedsecurity?
Usedinalmostallorganization,theRolebasedsecurityassigncertainprivilegestoeachrole.
Eachuserisassignedaparticularrolefromthelist.
Privilegesasperrolerestricttheuser'sactionsonthesystemandensurethatauserisabletodoonlywhatheispermittedtodo
onthesystem.

8.WhataretheHTMLservercontrolsinASP.NET?
HTMLservercontrolsaresimilartothestandardHTMLelementslikethoseusedinHTMLpages.
Theyexposepropertiesandeventsforprogramaticaluse.
Tomakethesecontrolsprogrammaticallyaccessible,wespecifythattheHTMLcontrolsactasaservercontrolbyaddingthe
runat="server"attribute.

9.a.)WhatarethevarioustypesofCookiesinASP.NET?
ThereexisttwotypesofcookiesinASP.NET
SessionCookieItresidesonthemachineoftheclientforasinglesessionandworksuntiltheuserlogsoutofthesession.
PersistentCookieItresidesonthemachineofauserforaspecifiedperiod.Thisperiodcanbesetupmanuallybytheuser.

b.)Howwouldyouturnoffcookiesononepageofyourwebsite?
ThiscanbedonebyusingtheCookie.Discardproperty.

ItGetsorsetsthediscardflagsetbytheserver.
Whensettotrue,thispropertyinstructstheclientapplicationnottosavetheCookieontheharddiskoftheuserattheendofthe
session.

c.)Howwouldyoucreateapermanentcookie?
Permanentcookiesarestoredontheharddiskandareavailableuntilaspecifiedexpirationdateisreached.
TocreateacookiethatneverexpiressetitsExpirespropertyequaltoDateTime.maxValue.

10.a.)ExplainCultureandUICulturevalues.
CulturevaluedeterminesthefunctionslikeDateandCurrencyusedtoformatdataandnumbersinaWebpage.
UICulturevaluedeterminestheresourceslikestringsorimagesloadedinaWebapplicationforaWebpage.

b.)WhatisGlobal.asaxfileusedfor?
Itexecutesapplicationleveleventsandsetsapplicationlevelvariables.

11.a.)ExplainASP.NETWebForms.
WebFormsareanextremelyimportantpartofASP.NET.
TheyaretheUserInterface(UI)elementswhichprovidethedesiredlookandfeeltoyourwebapplications.
WebFormsprovideproperties,methods,andeventsforthecontrolsthatareplacedontothem.

b.)Whatiseventbubbling?
Whenchildcontrolsendeventstoparentitistermedaseventbubbling.
ServercontrolslikeDatagrid,DataList,andRepeatercanhaveotherchildcontrolsinsidethem.

12.WhatarethevarioustypesofvalidationcontrolsprovidedbyASP.NET?
ASP.NETprovides6typesofvalidationcontrolsaslistedbelow:
i.)RequiredFieldValidatorItisusedwhenyoudonotwantthecontainertobeempty.Itchecksifthecontrolhasanyvalueornot.
ii.)RangeValidatorItchecksifthevalueinvalidatedcontroliswithinthespecifiedrangeornot.

iii.)CompareValidatorChecksifthevalueincontrolsmatchessomespecificvaluesornot.
iv.)RegularExpressionValidatorChecksifthevaluematchesaspecificregularexpressionornot.
v.)CustomValidatorUsedtodefineUserDefinedvalidation.
vi.)ValidationSummaryDisplayssummaryofallcurrentvalidationerrorsonanASP.NETpage.

13.Differentiatebetween:
a.)NamespaceandAssembly.
Namespaceisanamingconvenienceforlogicaldesigntimewhileanassemblyestablishesthenamescopefortypesatruntime.

b.)Earlybindingandlatebinding.
EarlybindingmeanscallinganonvirtualmethodthatisdecidedatacompiletimewhileLatebindingreferstocallingavirtual
methodthatisdecidedataruntime.

14.Whatarethedifferentkindsofassemblies?
Therecanbetwotypesofassemblies.
i.)Staticassemblies
Theyarestoredondiskinportableexecutablefiles.
Itincludes.NETFrameworktypeslikeinterfacesandclasses,resourcesfortheassembly(bitmaps,JPEGfiles,resourcefiles
etc.).
ii.)Dynamicassemblies
Theyarenotsavedondiskbeforeexecutionrathertheyrundirectlyfrommemory.
Theycanbesavedtodiskaftertheyhavebeenexecuted.

15.DifferentiatebetweenStructureandClass.

StructuresarevaluetypewhileClassesarereferencetype.
StructurescannothaveconstructorordestructorswhileClassescanhavethem.
StructuresdonotsupportInheritancewhileClassesdosupportInheritance.

16.ExplainViewState.
Itisa.Netmechanismtostoretheposteddataamongpostbacks.
Itallowsthestateofobjectstobestoredinahiddenfieldonthepage,savedonclientsideandtransportedbacktoserver
wheneverrequired.

17.WhatarethevarioustypesofAuthentication?
Thereare3typesofAuthenticationnamelyWindows,FormsandPassportAuthentication.
WindowsauthenticationItusesthesecurityfeaturesintegratedinWindowsNTandWindowsXPOStoauthenticateand
authorizeWebapplicationusers.
FormsauthenticationItallowsyoutocreateyourownlistofusersandvalidatetheiridentitywhentheyvisittheWebsite.
PassportauthenticationItusestheMicrosoftcentralizedauthenticationprovidertoidentifyusers.Passportallowsuserstousea
singleidentityacrossmultipleWebapplications.PassportSDKneedstobeinstalledtousePassportauthenticationinyourWeb
application.

18.ExplainServersidescriptingandClientsidescripting.
ServersidescriptingAllthescriptareexecutedbytheserverandinterpretedasneeded.
Clientsidescriptingmeansthatthescriptwillbeexecutedimmediatelyinthebrowsersuchasformfieldvalidation,email
validation,etc.ItisusaullaycarrriedoutinVBScriptorJavaScript.

19.a.)Whatisgarbagecollection?
Itisasystemwherearuntimecomponenttakesresponsibilityformanagingthelifetimeofobjectsandtheheapmemorythatthey
occupy.

b.)Explainserializationanddeserialization.
Serializationistheprocessofconvertinganobjectintoastreamofbytes.

Deserializationistheprocessofcreatinganobjectfromastreamofbytes.
Boththeseprocessesareusuallyusedtotransportobjects.

20.WhatarethevarioussessionstatemanagementoptionsprovidedbyASP.NET?
ASP.NETprovidestwosessionstatemanagementoptionsInProcessandOutofProcessstatemanagement.
InProcessstoresthesessioninmemoryonthewebserver.
OutofProcessstoresdatainanexternaldatasource.ThisdatasourcemaybeaSQLServeroraStateServerservice.Outof
Processstatemanagementneedsallobjectsstoredinsessiontobeserializable.
ASP.NETinterviewquestionsJan04,2011at05:16PMbyRahul

DescribehowPassportauthenticationworks.
ASP.NETapplicationwithPassportauthenticationimplementedcheckstheusersmachineforacurrentpassportauthentication
cookie.Ifitisnotavailable,ASP.NETdirectstheusertoaPassportsignonpage.ThePassportserviceauthenticatestheuser,
storesanauthenticationcookieontheuserscomputeranddirecttheusertotherequestedpage.

ExplainthestepstobefollowedtousePassportauthentication.
1.InstallthePassportSDK.
2.SettheapplicationsauthenticationmodetoPassportinWeb.config.
3.Setauthorizationtodenyunauthenticatedusers.
3.UsethePassportAuthentication_OnAuthenticateeventtoaccesstheusersPassportprofiletoidentifyandauthorizetheuser.
4.ImplementasignoutproceduretoremovePassportcookiesfromtheusersmachine.

ExplaintheadvantagesofPassportauthentication.
UserdoesnthavetorememberseparateusernamesandpasswordsforvariousWebsites
Usercanmaintainhisorherprofileinformationinasinglelocation.
PassportauthenticationalsoavailaccesstovariousMicrosoftservices,suchasPassportExpressPurchase.

Whatiscaching?
Cachingisthetechniqueofstoringfrequentlyuseditemsinmemorysothattheycanbeaccessedmorequickly.
Bycachingtheresponse,therequestisservedfromtheresponsealreadystoredinmemory.

ItsimportanttochoosetheitemstocachewiselyasCachingincursoverhead.
AWebformthatisfrequentlyusedanddoesnotcontaindatathatfrequentlychangesisgoodforcaching.
Acachedwebformfreezesformsserversidecontentandchangestothatcontentdonotappearuntilthecacheisrefreshed.
AdvancedAsp.netinterviewquestions
ASP.NETpracticetest

Explaintheuseofdurationattributeof@OutputCachepagedirective.
The@OutputCachedirectivesDurationattributedetermineshowlongthepageiscached.
Ifthedurationattributeissetto60seconds,theWebformiscachedfor60secondstheserverloadstheresponseinmemoryand
retainsthatresponsefor60seconds.
Anyrequestsduringthattimereceivethecachedresponse.
Oncethecachedurationhasexpired,thenextrequestgeneratesanewresponseandcachedforanother60seconds.
ASP.NETinterviewtest(20questions)new
ASP.NETinterviewtestforexperienced(19questions)
SqlServer(25questions)

1.Explainhowawebapplicationworks.
Answer:
Awebapplicationresidesintheserverandservestheclient'srequestsoverinternet.Theclientaccessthewebpageusingbrowser
fromhismachine.Whenaclientmakesarequest,itreceivestheresultintheformofHTMLwhichareinterpretedanddisplayedby
thebrowser.
AwebapplicationontheserversiderunsunderthemanagementofMicrosoftInternetInformationServices(IIS).IISpassesthe
requestreceivedfromclienttotheapplication.TheapplicationreturnstherequestedresultintheformofHTMLtoIIS,whichinturn,
sendstheresulttotheclient.

2.ExplaintheadvantagesofASP.NET.
Answer:
FollowingaretheadvantagesofASP.NET.

Webapplicationexistsincompiledformontheserversotheexecutionspeedisfasterascomparedtotheinterpretedscripts.
ASP.NETmakesdevelopmentsimplerandeasiertomaintainwithaneventdriven,serversideprogrammingmodel.
Beingpartof.Framework,ithasaccesstoallthefeaturesof.NetFramework.
Contentandprogramlogicareseparatedwhichreducestheinconveniencesofprogrammaintenance.
ASP.NETmakesforeasydeployment.Thereisnoneedtoregistercomponentsbecausetheconfigurationinformationisbuiltin.
Todevelopprogramlogic,adevelopercanchoosetowritetheircodeinmorethan25.NetlanguagesincludingVB.Net,C#,
JScript.Netetc.
Introductionofviewstatehelpsinmaintainingstateofthecontrolsautomaticallybetweenthepostbacksevents.
ASP.NEToffersbuiltinsecurityfeaturesthroughwindowsauthenticationorotherauthenticationmethods.
IntegratedwithADO.NET.
Builtincachingfeatures.

3.ExplainthedifferentpartsthatconstituteASP.NETapplication.
Answer:
Content,programlogicandconfigurationfileconstituteanASP.NETapplication.
Contentfiles
Contentfilesincludestatictext,imagesandcanincludeelementsfromdatabase.
Programlogic
ProgramlogicfilesexistasDLLfileontheserverthatrespondstotheuseractions.
Configurationfile

Configurationfileoffersvarioussettingsthatdeterminehowtheapplicationrunsontheserver.

4.DescribethesequenceofactiontakesplaceontheserverwhenASP.NETapplicationstarts
firsttime
Answer:
Followingarethesequences:
IISstartsASP.NETworkerprocessworkerprocessloadsassemblyinthememoryIISsendstherequesttotheassemblythe
assemblycomposesaresponseusingprogramlogicIISreturnstheresponsetotheuserintheformofHTML.

5.ExplainthecomponentsofwebforminASP.NET
Answer:
Servercontrols
TheservercontrolsareHypertextMarkupLanguage(HTML)elementsthatincludearunat=serverattribute.Theyprovideautomatic
statemanagementandserversideeventsandrespondtotheusereventsbyexecutingeventhandlerontheserver.
HTMLcontrols
Thesecontrolsalsorespondtotheusereventsbuttheeventsprocessinghappenontheclientmachine.
Datacontrols
Datacontrolsallowtoconnecttothedatabase,executecommandandretrievedatafromdatabase.
Systemcomponents
Systemcomponentsprovideaccesstosystemleveleventsthatoccurontheserver.

6.Describeinbrief.NETFrameworkanditscomponents.
Answer:
.NETFrameworkprovidesplatformfordevelopingwindowsandwebsoftware.ASP.NETisapartof.Netframeworkandcanaccess
allfeaturesimplementedwithinitthatwasformerlyavailableonlythroughwindowsAPI..NETFrameworksitsinbetweenour
applicationprogramsandoperatingsystem.

The.NetFrameworkhastwomaincomponents:
.NetFrameworkClassLibrary:Itprovidescommontypessuchasdatatypesandobjecttypesthatcanbesharedbyall.Net
compliantlanguage.
TheCommonlanguageRuntime:Itprovidesservicesliketypesafety,security,codeexecution,threadmanagement,
interoperabilityservices.

7.WhatisanAssembly?Explainitsparts
Answer:
Anassemblyexistsasa.DLLor.EXEthatcontainsMSILcodethatisexecutedbyCLR.Anassemblycontainsinterfaceand
classes,itcanalsocontainotherresourceslikebitmaps,filesetc.ItcarriesversiondetailswhichareusedbytheCLRduring
execution.Twoassembliesofthesamenamebutwithdifferentversionscanrunsidebysideenablingapplicationsthatdependon
aspecificversiontouseassemblyofthatversion.Anassemblyistheunitonwhichpermissionsaregranted.Itcanbeprivateor
global.Aprivateassemblyisusedonlybytheapplicationtowhichitbelongs,buttheglobalassemblycanbeusedbyany
applicationinthesystem.
Thefourpartsofanassemblyare:
AssemblyManifestItcontainsname,version,culture,andinformationaboutreferencedassemblies.
TypemetadataItcontainsinformationabouttypesdefinedintheassembly.
MSILMSILcode.
ResourcesFilessuchasBMPorJPGfileoranyotherfilesrequiredbyapplication.

8.DefineCommonTypeSystem.
Answer:
.Netallowsdeveloperstowriteprogramlogicinatleast25languages.Theclasseswritteninonelanguagecanbeusedbyother
languagesin.Net.Thisserviceof.NetispossiblethroughCTSwhichensuretherulesrelatedtodatatypesthatalllanguagemust
follow.Itprovidessetoftypesthatareusedbyall.NETlanguagesandensures.NETlanguagetypecompatibility.

9.DefineVirtualfolder.
Answer:
Itisthefolderthatcontainswebapplications.ThefolderthathasbeenpublishedasvirtualfolderbyIIScanonlycontainweb
applications.

10.DescribetheEventsintheLifeCycleofaWebApplication
Answer:
Awebapplicationstartswhenabrowserrequestsapageoftheapplicationfirsttime.TherequestisreceivedbytheIISwhichthen
startsASP.NETworkerprocess(aspnet_wp.exe).Theworkerprocessthenallocatesaprocessspacetotheassemblyandloadsit.
Anapplication_starteventoccursfollowedbySession_start.TherequestisthenprocessedbytheASP.NETengineandsends
backresponseintheformofHTML.Theuserreceivestheresponseintheformofpage.
Thepagecanbesubmittedtotheserverforfurtherprocessing.Thepagesubmittingtriggerspostbackeventthatcausesthe
browsertosendthepagedata,alsocalledasviewstatetotheserver.Whenserverreceivesviewstate,itcreatesnewinstanceof
thewebform.ThedataisthenrestoredfromtheviewstatetothecontrolofthewebforminPage_Initevent.
ThedatainthecontrolisthenavailableinthePage_loadeventofthewebform.Thecachedeventisthenhandledandfinallythe
eventthatcausedthepostbackisprocessed.Thewebformisthendestroyed.Whentheuserstopsusingtheapplication,
Session_endeventoccursandsessionends.Thedefaultsessiontimeis20minutes.Theapplicationendswhennouseraccessing
theapplicationandthistriggersApplication_Endevent.FinallyalltheresourcesoftheapplicationarereclaimedbytheGarbage
collector.

11.WhatarethewaysofpreservingdataonaWebForminASP.NET?
Answer:
ASP.NEThasintroducedviewstatetopreservedatabetweenpostbackevents.Viewstatecan'tavaildatatootherwebforminan
application.Toprovidedatatootherforms,youneedtosavedatainastatevariableintheapplicationorsessionobjects.

12.Defineapplicationstatevariableandsessionstatevariable.
Answer:

Theseobjectsprovidetwolevelsofscope:
ApplicationState
Datastoredintheapplicationobjectcanbesharedbyallthesessionsoftheapplication.Applicationobjectstoresdatainthekey
valuepair.
SessionState
SessionStatestoressessionspecificinformationandtheinformationisvisiblewithinthesessiononly.ASP.NETcreatesunique
sessionIdforeachsessionoftheapplication.SessionIDsaremaintainedeitherbyanHTTPcookieoramodifiedURL,assetinthe
applicationsconfigurationsettings.Bydefault,SessionIDvaluesarestoredinacookie.

13.DescribetheapplicationeventhandlersinASP.NET
Answer:
Followingaretheapplicationeventhandlers:
Application_Start:Thiseventoccurswhenthefirstuservisitsapageoftheapplication.
Application_End:Thiseventoccurswhentherearenomoreusersoftheapplication.
Application_BeginRequest:Thisoccursatthebeginningofeachrequesttotheserver.
Application_EndRequest:occursattheendofeachrequesttotheserver.
Session_Start:Thiseventoccurseverytimewhenanynewuservisits.
Session_End:occurswhentheusersstoprequestingpagesandtheirsessiontimesout.

14.WhataretheWebFormEventsavailableinASP.NET?
Answer:
Page_Init
Page_Load
Page_PreRender
Page_Unload
Page_Disposed
Page_Error
Page_AbortTransaction
Page_CommitTransaction

Page_DataBinding

15.DescribetheServerControlEventsofASP.NET.
Answer:
ASP.NEToffersmanyservercontrolslikebutton,textbox,DropDownListetc.Eachcontrolcanrespondtotheuser'sactionsusing
eventsandeventhandlermechanism.
Therearethreetypesofservercontrolevents:
Postbackevents
Thiseventssendsthewebpagetotheserverforprocessing.Webpagesendsdatabacktothesamepageontheserver.
Cachedevents
Theseeventsareprocessedwhenapostbackeventoccurs.
Validationevents
Theseeventsoccurjustbeforeapageispostedbacktotheserver.

16.Howdoyouchangethesessiontimeoutvalue?
Answer:
Thesessiontimeoutvalueisspecifiedintheweb.configfilewithinsessionstateelement.Youcanchangethesessiontimeout
settingbychangingvalueoftimeoutattributeofsessionstateelementinweb.configfile.

17.DescribehowASP.NETmaintainsprocessisolationforeachWebapplication
Answer:
InASP.NET,whenIISreceivesarequest,IISusesaspnet_isapi.dlltocalltheASP.NETworkerprocess(aspnet_wp.exe).The
ASP.NETworkerprocessloadstheWebapplication'sassembly,allocatingoneprocessspace,calledtheapplicationdomain,for
eachapplication.ThisisthehowASP.NETmaintainsprocessisolationforeachWebapplication.

18.Definenamespace.

Answer:
Namespacesarethewaytoorganizeprogrammingcode.Itremovesthechancesofnameconflict.Itisquitepossibletohaveone
nameforanitemaccidentallyinlargeprojectsthoseresultsintoconflict.Byorganizingyourcodeintonamespaces,youreducethe
chanceoftheseconflicts.YoucancreatenamespacesbyenclosingaclassinaNamespace...EndNamespaceblock.
YoucanusenamespacesoutsideyourprojectbyreferringthemusingReferencesdialogbox.YoucanuseImportsorusing
statementtothecodefiletoaccessmembersofthenamespacesincode.

19.WhataretheoptionsinASP.NETtomaintainstate?
Answer:
Clientsidestatemanagement
ThismaintainsinformationontheclientsmachineusingCookies,ViewState,andQueryStrings.
Cookies
Acookieisasmalltextfileontheclientmachineeitherintheclientsfilesystemormemoryofclientbrowsersession.Cookiesare
notgoodforsensitivedata.Moreover,Cookiescanbedisabledonthebrowser.Thus,youcantrelyoncookiesforstate
management.
ViewState
EachpageandeachcontrolonthepagehasViewStateproperty.Thispropertyallowsautomaticretentionofpageandcontrols
statebetweeneachtriptoserver.Thismeanscontrolvalueismaintainedbetweenpagepostbacks.Viewstateisimplementedusing
_VIEWSTATE,ahiddenformfieldwhichgetscreatedautomaticallyoneachpage.Youcanttransmitdatatootherpageusingview
state.
Querystring
Querystringscanmaintainlimitedstateinformation.DatacanbepassedfromonepagetoanotherwiththeURLbutyoucansend
limitedsizeofdatawiththeURL.Mostbrowsersallowalimitof255charactersonURLlength.
Serversidestatemanagement
Thiskindofmechanismretainsstateintheserver.
ApplicationState

Thedatastoredintheapplicationobjectcanbesharedbyallthesessionsoftheapplication.Applicationobjectstoresdatainthe
keyvaluepair.
SessionState
SessionStatestoressessionspecificinformationandtheinformationisvisiblewithinthesessiononly.ASP.NETcreatesunique
sessionIdforeachsessionoftheapplication.SessionIDsaremaintainedeitherbyanHTTPcookieoramodifiedURL,assetinthe
applicationsconfigurationsettings.Bydefault,SessionIDvaluesarestoredinacookie.
Database
Databasecanbeusedtostorelargestateinformation.Databasesupportisusedincombinationwithcookiesorsessionstate.

20.ExplainthedifferencebetweenServercontrolandHTMLcontrol.
Answer:
Serverevents
ServercontroleventsarehandledintheserverwhereasHTMLcontroleventsarehandledinthepage.
Statemanagement
ServercontrolscanmaintaindataacrossrequestsusingviewstatewhereasHTMLcontrolshavenosuchmechanismtostoredata
betweenrequests.
Browserdetection
ServercontrolscandetectbrowserautomaticallyandadaptdisplayofcontrolaccordinglywhereasHTMLcontrolscantdetect
browserautomatically.
Properties
ServercontrolscontainpropertieswhereasHTMLcontrolshaveattributesonly.

21.WhatarethevalidationcontrolsavailableinASP.NET?
Answer:
ASP.NETvalidationcontrolsare:
RequiredFieldValidator:Thisvalidatescontrolsifcontrolscontaindata.

CompareValidator:Thisallowscheckingifdataofonecontrolmatchwithothercontrol.
RangeValidator:Thisverifiesifentereddataisbetweentwovalues.
RegularExpressionValidator:Thischecksifentereddatamatchesaspecificformat.
CustomValidator:Validatethedataenteredusingaclientsidescriptoraserversidecode.
ValidationSummary:Thisallowsdevelopertodisplayerrorsinoneplace.

22.Definethestepstosetupvalidationcontrol.
Answer:
Followingarethestepstosetupvalidationcontrol
Dragavalidationcontrolonawebform.
SettheControlToValidatepropertytothecontroltobevalidated.
IfyouareusingCompareValidator,youhavetospecifytheControlToCompareproperty.
SpecifytheerrormessageyouwanttodisplayusingErrorMessageproperty.
YoucanuseValidationSummarycontroltoshowerrorsatoneplace.

23.WhatarethenavigationwaysbetweenpagesavailableinASP.NET?
Answer:
Waystonavigatebetweenpagesare:
Hyperlinkcontrol
Response.Redirectmethod
Server.Transfermethod
Server.Executemethod
Window.Openscriptmethod

24.Howdoyouopenapageinanewwindow?

Answer:
Toopenapageinanewwindow,youhavetouseclientscriptusingonclick="window.open()"attributeofHTMLcontrol.

25.Defineauthenticationandauthorization.
Answer:
Authorization:Theprocessofgrantingaccessprivilegestoresourcesortaskswithinanapplication.
Authentication:Theprocessofvalidatingtheidentityofauser.

26.Definecaching.
Answer:
Cachingisthetechniqueofstoringfrequentlyuseditemsinmemorysothattheycanbeaccessedmorequickly.Cachingtechnique
allowstostore/cachepageoutputorapplicationdataontheclientontheserver.Thecachedinformationisusedtoserve
subsequentrequeststhatavoidtheoverheadofrecreatingthesameinformation.Thisenhancesperformancewhensame
informationisrequestedmanytimesbytheuser.

27.Definecookie.
Answer:
Acookieisasmallfileontheclientcomputerthatawebapplicationusestomaintaincurrentsessioninformation.Cookiesareused
toidentityauserinafuturesession.

28.Whatisdelegate?
Answer:
Adelegateactslikeastronglytypefunctionpointer.Delegatescaninvokethemethodsthattheyreferencewithoutmakingexplicit
callstothosemethods.Itistypesafesinceitholdsreferenceofonlythosemethodsthatmatchitssignature.Unlikeotherclasses,
thedelegateclasshasasignature.Delegatesareusedtoimplementeventprogrammingmodelin.NETapplication.Delegates
enablethemethodsthatlistenforanevent,tobeabstract.

29.ExplainExceptionhandlingin.Net.

Answer:
Exceptionsorerrorsareunusualoccurrencesthathappenwithinthelogicofanapplication.TheCLRhasprovidedstructuredwayto
dealwithexceptionsusingTry/Catchblock.ASP.NETsupportssomefacilitiestohandlingexceptionsusingeventssuckas
Page_ErrorandApplication_Error.

30.Whatisimpersonation?
Answer:
Impersonationmeansdelegatingoneuseridentitytoanotheruser.InASP.NET,theanonymoususersimpersonatetheASPNET
useraccountbydefault.Youcanuse<identity>elementofweb.configfiletoimpersonateuser.E.g.<identityimpersonate="true"/>

31.Whatismanagedcodein.Net?
Answer:
Thecodethatrunsundertheguidanceofcommonlanguageruntime(CLR)iscalledmanagedcode.Theversioningandregistration
problemwhichareformallyhandledbythewindowsprogrammingaresolvedin.Netwiththeintroductionofmanagedcode.The
managedcodecontainsalltheversioningandtypeinformationthattheCLRusetoruntheapplication.

32.WhatareMergemodules?
Answer:
Mergemodulesarethedeploymentprojectsforthesharedcomponents.Ifthecomponentsarealreadyinstalled,themodulesmerge
thechangesratherthanunnecessarilyoverwritethem.Whenthecomponentsarenolongerinuse,theyareremovedsafelyfrom
theserverusingMergemodulesfacility.

33.WhatisSatelliteassembly?
Answer:
Satelliteassemblyisakindofassemblythatincludeslocalizedresourcesforanapplication.Eachsatelliteassemblycontainsthe
resourcesforoneculture.

34.Definesecuredsocketslayer.
Answer:

SecuredSocketLayer(SSL)ensuresasecuredwebapplicationbyencryptingthedatasentoverinternet.Whenanapplicationis
usingSSLfacility,theservergeneratesanencryptionkeyforthesessionandpageisencryptedbeforeitsent.Theclientbrowse
usesthisencryptionkeytodecrypttherequestedWebpage.

35.DefinesessioninASP.NET.
Answer:
Asessionstartswhenthebrowserfirstrequestaresourcesfromwithintheapplication.Thesessiongetsterminatedwheneither
browsercloseddownorsessiontimeouthasbeenattained.Thedefaulttimeoutforthesessionis20minutes.

36.DefineTracing.
Answer:
Tracingisthewaytomaintaineventsinanapplication.Itisusefulwhiletheapplicationisindebuggingorinthetestingphase.The
traceclassinthecodeisusedtodiagnoseproblem.Youcanusetracemessagestoyourprojecttomonitoreventsinthereleased
versionoftheapplication.ThetraceclassisfoundintheSystem.Diagnosticsnamespace.ASP.NETintroducestracingthat
enablesyoutowritedebugstatementsinyourcode,whichstillremaininthecodeevenafterwhenitisdeployedtoproduction
servers.

37.DefineViewState.
Answer:
ASP.NETpreservesdatabetweenpostbackeventsusingviewstate.Youcansavealotofcodingusingviewstateintheweb
form.ViewStateserializethestateofobjectsandstoreinahiddenfieldonthepage.Itretainsthestateofserversideobjects
betweenpostbacks.Itrepresentsthestatusofthepagewhensubmittedtotheserver.Bydefault,viewstateismaintainedforeach
page.IfyoudonotwanttomaintaintheViewState,includethedirective<%@PageEnableViewState="false"%>atthetopofan
.aspxpageoraddtheattributeEnableViewState="false"toanycontrol.ViewStateexistforthelifeofthecurrentpage.

38.Whatisapplicationdomain?
Answer:
ItistheprocessspacewithinwhichASP.NETapplicationruns.Everyapplicationhasitsownprocessspacewhichisolatesitfrom
otherapplication.Ifoneoftheapplicationdomainsthrowserroritdoesnotaffecttheotherapplicationdomains.

39.Listdownthesequenceofmethodscalledduringthepageload.
Answer:
Init()Initializesthepage.
Load()Loadsthepageintheservermemory.
PreRender()thebriefmomentbeforethepageisdisplayedtotheuserasHTML
Unload()runsjustafterpagefinishesloading.

40.WhatistheimportanceofGlobal.asaxinASP.NET?
Answer:
TheGlobal.asaxisusedtoimplementapplicationandsessionlevelevents.

41.DefineMSIL.
Answer:
MSIListheMicrosoftIntermediateLanguage.All.Netlanguages'executableexistsasMSILwhichgetsconvertedintomachine
specificlanguageusingJITcompilerjustbeforeexecution.

42.Response.RedirectvsServer.Transfer
Answer:
Server.Transferisonlyapplicableforaspxfiles.Ittransferspageprocessingtoanotherpagewithoutmakingroundtripbacktothe
client'sbrowser.Sincenoroundtrips,itoffersfasterresponseanddoesn'tupdateclienturlhistorylist.
Response.Redirectisusedtoredirecttoanotherpageorsite.Thisperformsatripbacktotheclientwheretheclientsbrowseris
redirectedtothenewpage.

43.ExplainSessionstatemanagementoptionsinASP.NET.
Answer:
ASP.NETprovidesInProcessandOutofProcessstatemanagement.InProcessstoresthesessioninmemoryonthewebserver.
OutofProcessSessionstatemanagementstoresdatainanexternaldatasourcesuchasSQLServeroraStateServerservice.

OutofProcessstatemanagementrequiresthatallobjectsstoredinsessionareserializable.

44.Howtoturnoffcookiesforapage?
Answer:
Cookie.DiscardPropertywhentrue,instructstheclientapplicationnottosavetheCookieontheuser'sharddiskwhenasession
ends.

45.Howcanyouensureapermanentcookie?
Answer:
SettingExpirespropertytoMinValueandrestrictcookietogetexpired.

46.WhatisAutoPostback?
Answer:
AutoPostBackautomaticallypoststhepagebacktotheserverwhenstateofthecontrolischanged.

47.Explainlogincontrolandformauthentication.
Answer:
LogincontrolsencapsulateallthefeaturesofferedbyFormsauthentication.LogincontrolsinternallyuseFormsAuthenticationclass
toimplementsecuritybypromptingforusercredentialsvalidatingthem.

48.WhatistheuseofWeb.configfile?
Answer:
Followingarethesettingyoucanincorporateinweb.configfile.
Databaseconnections
ErrorPagesetting
SessionStates
ErrorHandling

Security
Tracesetting
Culturespecificsetting

49.Explaininwhatorderadestructorsiscalled.
Answer:
Destructorsarecalledinreverseorderofconstructors.Destructorofmostderivedclassiscalledfollowedbyitsparent'sdestructor
andsoontillthetopmostclassinthehierarchy.

50.Whatisbreakmode?Whataretheoptionstostepthroughcode?
Answer:
Breakmodeletsyoutoobservecodelinetolineinordertolocateerror.VS.NETprovidesfollowingoptiontostepthroughcode.
StepInto
StepOver
StepOut
RunToCursor
SetNextStatement

51.ExplainhowtoretrievepropertysettingsfromXML.configfile.
Answer:
CreateaninstanceofAppSettingsReaderclass,useGetValuemethodbypassingthenameofthepropertyandthetypeexpected.
Assigntheresulttotheappropriatevariable.

52.ExplainGlobalAssemblyCache.
Answer:
GlobalAssemblyCacheistheplaceholderforsharedassembly.IfanassemblyisinstalledtotheGlobalAssemblyCache,the
assemblycanbeaccessedbymultipleapplications.InordertoinstallanassemblytotheGAC,theassemblymusthavetobe
signedwithstrongname.

53.ExplainManagedcodeanUnmanagedcode.
Answer:
Managedcoderunsunderthesafesupervisionofcommonlanguageruntime.Managedcodecarriesmetadatathatisusedby
commonlanguageruntimetoofferservicelikememorymanagement,codeaccesssecurity,andcrosslanguageaccessibility.
Unmanagedcodedoesn'tfollowCLRconventionsandthus,can'ttaketheadvantagesof.Framework.

54.Whatissidebysideexecution?
Answer:
Thismeansmultipleversionofsameassemblytorunonthesamecomputer.Thisfeatureenablestodeploymultipleversionsof
thecomponent.

55.DefineResourceFiles.
Answer:
Resourcefilescontainsnonexecutabledatalikestrings,imagesetcthatareusedbyanapplicationanddeployedalongwithit.You
canchangesthesedatawithoutrecompilingthewholeapplication.

56.DefineGlobalizationandLocalization.
Answer:
Globalizationistheprocessofcreatingmultilingualapplicationbydefiningculturespecificfeatureslikecurrency,dateandtime
format,calendarandotherissues.Localizationistheprocessofaccommodatingculturaldifferencesinanapplication.

57.Whatisreflection?
Answer:
Reflectionisamechanismthroughwhichtypesdefinedinthemetadataofeachmodulecanbeaccessed.TheSystem.Reflection
namespacescontainsclassesthatcanbeusedtodefinethetypesforanassembly.

58.DefineSatelliteAssemblies.

Answer:
SatelliteAssembliesarethespecialkindsofassembliesthatexistasDLLandcontainculturespecificresourcesinabinaryformat.
Theystorecompiledlocalizedapplicationresources.TheycanbecreatedusingtheALutilityandcanbedeployedevenafter
deploymentoftheapplication.SatelliteAssembliesencapsulateresourcesintobinaryformatandthusmakesresourceslighterand
consumelesserspaceonthedisk.

59.WhatisCAS?
Answer:
CASisveryimportantpartof.Netsecuritysystemwhichverifiesifparticularpieceofcodeisallowedtorun.Italsodeterminesif
pieceofcodehaveaccessrightstorunparticularresource..NETsecuritysystemappliesthesefeaturesusingcodegroupsand
permissions.Eachassemblyofanapplicationisthepartofcodegroupwithassociatedpermissions.

60.ExplainAutomaticMemoryManagementin.NET.
Answer:
Automaticmemorymanagementin.Netisthroughgarbagecollectorwhichisincrediblyefficientinreleasingresourceswhenno
longerinuse.

Vous aimerez peut-être aussi