asp.net question

Upload: amod

Post on 12-Mar-2016

9 views

Category:

Documents


0 download

DESCRIPTION

Asp.Net Question

TRANSCRIPT

  • 300asp.netinterviewquestionsandanswersASP.NETinterviewquestionsMay25,2014at03:36PMbyRajSingh

    DescribestatemanagementinASP.NET.

    Statemanagementisatechniquetomanageastateofanobjectondifferentrequest.

    TheHTTPprotocolisthefundamentalprotocoloftheWorldWideWeb.HTTPisastatelessprotocolmeanseveryrequestisfromnewuserwithrespecttowebserver.HTTPprotocoldoesnotprovideyouwithanymethodofdeterminingwhetheranytworequestsaremadebythesameperson.

    Maintainingstateisimportantinanywebapplication.TherearetwotypesofstatemanagementsysteminASP.NET.

    ClientsidestatemanagementServersidestatemanagement

    Explainclientsidestatemanagementsystem.

    ASP.NETprovidesseveraltechniquesforstoringstateinformationontheclient.Theseincludethefollowing:

    viewstateASP.NETusesviewstatetotrackvaluesincontrolsbetweenpagerequests.Itworkswithinthepageonly.Youcannotuseviewstatevalueinnextpage.

    controlstate:Youcanpersistinformationaboutacontrolthatisnotpartoftheviewstate.Ifviewstateisdisabledforacontrolorthepage,thecontrolstatewillstillwork.

    hiddenfields:Itstoresdatawithoutdisplayingthatcontrolanddatatotheusersbrowser.Thisdataispresentedbacktotheserverandisavailablewhentheformisprocessed.Hiddenfieldsdataisavailablewithinthepageonly(pagescopeddata).

    Cookies:Cookiesaresmallpieceofinformationthatservercreatesonthebrowser.Cookiesstoreavalueintheusersbrowserthatthebrowsersendswitheverypagerequesttothewebserver.

    Querystrings:Inquerystrings,valuesarestoredattheendoftheURL.Thesevaluesarevisibletotheuserthroughhisorherbrowsersaddressbar.Querystringsarenotsecure.Youshouldnotsendsecretinformationthroughthequerystring.

    Explainserversidestatemanagementsystem.

    Thefollowingobjectsareusedtostoretheinformationontheserver:

  • ApplicationState:

    ThisobjectstoresthedatathatisaccessibletoallpagesinagivenWebapplication.TheApplicationobjectcontainsglobalvariablesforyourASP.NETapplication.

    CacheObject:Cachingistheprocessofstoringdatathatisusedfrequentlybytheuser.Cachingincreasesyourapplicationsperformance,scalability,andavailability.Youcancatchthedataontheserverorclient.

    SessionState:Sessionobjectstoresuserspecificdatabetweenindividualrequests.Thisobjectissameasapplicationobjectbutitstoresthedataaboutparticularuser.

    Explaincookieswithexample.

    Acookieisasmallamountofdatathatservercreatesontheclient.Whenawebservercreatesacookie,anadditionalHTTPheaderissenttothebrowserwhenapageisservedtothebrowser.TheHTTPheaderlookslikethis:

    SetCookie:message=Hello.Afteracookiehasbeencreatedonabrowser,wheneverthebrowserrequestsapagefromthesameapplicationinthefuture,thebrowsersendsaheaderthatlookslikethis:

    Cookie:message=Hello

    Cookieislittlebitoftextinformation.Youcanstoreonlystringvalueswhenusingacookie.Therearetwotypesofcookies:

    SessioncookiesPersistentcookies.

    Asessioncookieexistsonlyinmemory.Ifauserclosesthewebbrowser,thesessioncookiedeletepermanently.

    Apersistentcookie,ontheotherhand,canavailableformonthsorevenyears.Whenyoucreateapersistentcookie,thecookieisstoredpermanentlybytheusersbrowserontheuserscomputer.

    Creatingcookie

    protectedvoidbtnAdd_Click(objectsender,EventArgse){Response.Cookies[message].Value=txtMsgCookie.Text}

    //HeretxtMsgCookieistheIDofTextBox.

  • //cookienamesarecasesensitive.CookienamedmessageisdifferentfromsettingacookienamedMessage.

    Theaboveexamplecreatesasessioncookie.Thecookiedisappearswhenyoucloseyourwebbrowser.Ifyouwanttocreateapersistentcookie,thenyouneedtospecifyanexpirationdateforthecookie.

    Response.Cookies[message].Expires=DateTime.Now.AddYears(1)

    ReadingCookiesvoidPage_Load(){if(Request.Cookies[message]!=null)lblCookieValue.Text=Request.Cookies[message].Value}//HerelblCookieValueistheIDofLabelControl.

    Describethedisadvantageofcookies.

    Cookiecanstoreonlystringvalue.Cookiesarebrowserdependent.Cookiesarenotsecure.Cookiescanstoresmallamountofdata.

    WhatisSessionobject?Describeindetail.

    HTTPisastatelessprotocolitcan'tholdtheuserinformationonwebpage.Ifuserinsertssomeinformation,andmovetothenextpage,thatdatawillbelostanduserwouldnotabletoretrievetheinformation.Foraccessingthatinformationwehavetostoreinformation.Sessionprovidesthatfacilitytostoreinformationonservermemory.Itcansupportanytypeofobjecttostore.ForeveryuserSessiondatastoreseparatelymeanssessionisuserspecific.

  • StoringthedatainSessionobject.

    Session[message]=HelloWorld!

    RetrevingthedatafromSessionobject.

    Label1.Text=Session[message].ToString()

    WhataretheAdvantagesandDisadvantagesofSession?

    Followingarethebasicadvantagesanddisadvantagesofusingsession.

    Advantages:

    Itstoresuserstatesanddatatoallovertheapplication.

    Easymechanismtoimplementandwecanstoreanykindofobject.

    Storeseveryuserdataseparately.

    Sessionissecureandtransparentfromuserbecausesessionobjectisstoredontheserver.

    Disadvantages:

    Performanceoverheadincaseoflargenumberofuser,becauseofsessiondatastoredinservermemory.

  • OverheadinvolvedinserializingandDeSerializingsessionData.BecauseIncaseofStateServerandSQLServersessionmodeweneedtoserializetheobjectbeforestore.

    DescribetheMasterPage.

    MasterpagesinASP.NETworksasatemplatethatyoucanreferencethispageinallothercontentpages.Masterpagesenableyoutodefinethelookandfeelofallthepagesinyoursiteinasinglelocation.Ifyouhavedonechangesinmasterpage,thenthechangeswillreflectinallthewebpagesthatreferencemasterpages.Whenusersrequestthecontentpages,theymergewiththemasterpagetoproduceoutputthatcombinesthelayoutofthemasterpagewiththecontentfromthecontentpage.

    ContentPlaceHoldercontrolisavailableonlyonmasterpage.YoucanusemorethanoneContentPlaceHoldercontrolinmasterpage.Tocreateregionsthatcontentpagescanfillin,youneedtodefineContentPlaceHoldercontrolsinmasterpageasfollows:

  • ThepagespecificcontentisthenputinsideaContentcontrolthatpointstotherelevant

    ContentPlaceHolder:

    NotethattheContentPlaceHolderIDattributeoftheContentcontrolpointstotheContentPlaceHolderthatisdefinedinthemasterpage.

    Themasterpageisidentifiedbyaspecial@Masterdirectivethatreplacesthe@Pagedirectivethatisusedforordinary.aspxpages.

    HowyoucanaccessthePropertiesandControlsofMasterPagesfromcontentpages?

    YoucanaccessthePropertiesandControlsofMasterPagesfromcontentpages.InmanysituationsyouneedUsersNameindifferentcontentpages.Youcansetthisvalueinsidethemasterpageandthenmakeitavailabletocontentpagesasapropertyofthemasterpage.

    Wewillfollowthefollowingstepstoreferencethepropertiesofmasterpagefromcontentpages.

    Step:1

    Createapropertyinthemasterpagecodebehindfile.

    publicStringUserName{get{return(String)Session["Name"]}set{Session["Name"]=value}}

    Step:2

  • Addthe@MasterTypedeclarationtothe.aspxcontentpagetoreferencemasterpropertiesinacontentpage.Thisdeclarationisaddedjustbelowthe@Pagedeclarationasfollows:

    Step:3

    Onceyouaddthe@MasterTypedeclaration,youcanreferencepropertiesinthemasterpageusingtheMasterclass.ForexampletakealabelcontrolthatidisID="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.TherearemanywaystonavigatefromonepagetoanotherinASP.NET.

    ClientsidenavigationCrosspagepostingClientsidebrowserredirectClientSideNavigation

    Clientsidenavigation:

  • ClientsidenavigationallowstheusertonavigatefromonepagetoanotherbyusingclientsidecodeorHTML.ItrequestsanewWebpageinresponsetoaclientsideevent,suchasclickingahyperlinkorexecutingJavaScriptaspartofabuttonclick.

    Example:

    DragaHyperLinkcontrolontheformandsettheNavigateUrlpropertytothedesireddestinationpage.

    HyperLinkControl:Source

    TakeatestfromCareerRide

    Supposethat,thiscontrolisplacedonaWebpagecalledCareerRide.aspx,andtheHyperLinkcontrolisclicked,thebrowsersimplyrequeststheWelcome.aspxpage.

    SecondmethodofclientsidenavigationisthroughJavaScript.

    Example:

    TakeanHTMLbuttoncontrolonwebpage.FollowingistheHTMLcodefortheinputbutton.

    WhentheButton1isclicked,theclientsidemethod,Button1_onclickwillbecalled.TheJavaScriptsourcefortheButton1_onclickmethodisasfollows:

    functionButton1_onclick(){document.location="NavigateTest2.aspx"}

    Crosspageposting:

    Example:

    Supposethatwehavetwopages,thefirstpageisFirstPage.aspxandSecondpageisSecondPage.aspx.TheFirstPagehasa

  • ButtonandTextBoxcontrolanditsIDisButton1andTextBox1respectively.AButtoncontrolhasitsPostBackUrlproperty.Setthispropertyto~/SecondPage.aspx.WhentheuserclicksonButton,thedatawillsendtoSecondPageforprocessing.ThecodeforSecondPageisasfollows:

    protectedvoidPage_Load(objectsender,EventArgse){if(Page.PreviousPage==null){Label1.Text="Nopreviouspageinpost"}else{Label1.Text=((TextBox)PreviousPage.FindControl("TextBox1")).Text}}

    ThesecondpagecontainsaLabelcontrolanditsIDisLabel1.

    ThepagethatreceivesthePostBackreceivestheposteddatafromthefirstpageforprocessing.Wecanconsiderthispageastheprocessingpage.TheprocessingpageoftenneedstoaccessdatathatwascontainedinsidetheinitialpagethatcollectedthedataanddeliveredthePostBack.ThepreviouspagesdataisavailableinsidethePage.PreviousPageproperty.Thispropertyisonlysetifacrosspagepostoccurs.

    Clientsidebrowserredirect:

    ThePage.ResponseobjectcontainstheRedirectmethodthatcanbeusedinyourserversidecodetoinstructthebrowsertoinitiatearequestforanotherWebpage.TheredirectisnotaPostBack.ItissimilartotheuserclickingahyperlinkonaWebpage.

    Example:

    protectedvoidButton1_Click(objectsender,EventArgse){Response.Redirect("Welcome.aspx")}

    Inclientsidebrowserredirectmethodanextraroundtriptotheserverishappened.

  • Serversidetransfer:

    InthistechniqueServer.Transfermethodisused.TheTransfermethodtransferstheentirecontextofaWebpageovertoanotherpage.Thepagethatreceivesthetransfergeneratestheresponsebacktotheusersbrowser.InthismechanismtheusersInternetaddressinhisbrowserdoesnotshowtheresultofthetransfer.Theusersaddressbarstillreflectsthenameoftheoriginallyrequestedpage.

    protectedvoidButton1_Click(objectsender,EventArgse){Server.Transfer("MyPage.aspx",false)}

    TheTransfermethodhasanoverloadthatacceptsaBooleanparametercalledpreserveForm.Yousetthisparametertoindicateifyouwanttokeeptheformandquerystringdata.

    ASP.NETinterviewquestionsApril16,2013at01:36PMbyKshipraSingh

    1.WhatdoestheOrientationpropertydoinaMenucontrol?

    OrientationpropertyoftheMenucontrolsetsthedisplayofmenuonaWebpagetoverticalorhorizontal.Originallytheorientationissettovertical.

    2.Differentiatebetween:

    a.)ClientsideandserversidevalidationsinWebpages.

    Clientsidevalidationshappendsattheclient'ssidewiththehelpofJavaScriptandVBScript.ThishappensbeforetheWebpageissenttotheserver.Serversidevalidationsoccursplaceattheserverside.

    b.)Authenticationandauthorization.

    Authenticationistheprocessofverifyngtheidentityofauserusingsomecredentialslikeusernameandpasswordwhileauthorizationdeterminesthepartsofthesystemtowhichaparticularidentityhasaccess.Authenticationisrequiredbeforeauthorization.

    Fore.g.Ifanemployeeauthenticateshimselfwithhiscredentialsonasystem,authorizationwilldetermineifhehasthecontrol

  • overjustpublishingthecontentoralsoeditingit.

    3.a.)Whatdoesthe.WebPartfiledo?

    ItexplainsthesettingsofaWebPartscontrolthatcanbeincludedtoaspecifiedzoneonaWebpage.

    b.)Howwouldyouenableimpersonationintheweb.configfile?

    Inordertoenabletheimpersonationintheweb.confingfile,takethefollowingsteps:Includetheelementintheweb.configfile.Settheimpersonateattributetotrueasshownbelow:

    4.a.)Differentiatebetween

    a.)Filebaseddependencyandkeybaseddependency.

    Infilebaseddependency,thedependencyisonafilesavedinadiskwhileinkeybaseddependency,youdependonanothercacheditem.

    b.)Globalizationandlocalization.GlobalizationisatechniquetoidentifythepartofaWebapplicationthatisdifferentfordifferentlanguagesandseparateitoutfromthewebapplicationwhileinlocalizationyoutrytoconfigureaWebapplicationsothatitcanbesupportedforaspecificlanguageorlocale.

    5.a.)Differentiatebetweenapagethemeandaglobaltheme?

    Pagethemeappliestoaparticularwebpagesoftheproject.ItisstoredinsideasubfolderoftheApp_Themesfolder.Globalthemeappliestoallthewebapplicationsonthewebserver.ItisstoredinsidetheThemesfolderonaWebserver.

    b.)WhatareWebservercontrolsinASP.NET?

    ThesearetheobjectsonASP.NETpagesthatrunwhentheWebpageisrequested.SomeoftheseWebservercontrols,likebuttonandtextbox,aresimilartotheHTMLcontrols.Somecontrolsexhibitcomplexbehaviorlikethecontrolsusedtoconnecttodatasourcesanddisplaydata.

    6.a.)DifferentiatebetweenaHyperLinkcontrolandaLinkButtoncontrol.

  • AHyperLinkcontroldoesnothavetheClickandCommandeventswhiletheLinkButtoncontrolhasthem,whichcanbehandledinthecodebehindfileoftheWebpage.

    b.)HowdoCookieswork?Giveanexampleoftheirabuse.

    Theserverdirectsthebrowsertoputsomefilesinacookie.Allthecookiesarethensentforthedomainineachrequest.Anexampleofcookieabusecouldbeacasewherealargecookieisstoredaffectingthenetworktraffic.

    7.a.)WhatareCustomUserControlsinASP.NET?

    Thesearethecontrolsdefinedbydevelopersandworksimilarttootherwebservercontrols.Theyareamixtureofcustombehaviorandpredefinedbehavior.

    b.)WhatisRolebasedsecurity?

    Usedinalmostallorganization,theRolebasedsecurityassigncertainprivilegestoeachrole.Eachuserisassignedaparticularrolefromthelist.Privilegesasperrolerestricttheuser'sactionsonthesystemandensurethatauserisabletodoonlywhatheispermittedtodoonthesystem.

    8.WhataretheHTMLservercontrolsinASP.NET?

    HTMLservercontrolsaresimilartothestandardHTMLelementslikethoseusedinHTMLpages.Theyexposepropertiesandeventsforprogramaticaluse.Tomakethesecontrolsprogrammaticallyaccessible,wespecifythattheHTMLcontrolsactasaservercontrolbyaddingtherunat="server"attribute.

    9.a.)WhatarethevarioustypesofCookiesinASP.NET?

    ThereexisttwotypesofcookiesinASP.NET

    SessionCookieItresidesonthemachineoftheclientforasinglesessionandworksuntiltheuserlogsoutofthesession.PersistentCookieItresidesonthemachineofauserforaspecifiedperiod.Thisperiodcanbesetupmanuallybytheuser.

    b.)Howwouldyouturnoffcookiesononepageofyourwebsite?

    ThiscanbedonebyusingtheCookie.Discardproperty.

  • ItGetsorsetsthediscardflagsetbytheserver.Whensettotrue,thispropertyinstructstheclientapplicationnottosavetheCookieontheharddiskoftheuserattheendofthesession.

    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.

    EarlybindingmeanscallinganonvirtualmethodthatisdecidedatacompiletimewhileLatebindingreferstocallingavirtualmethodthatisdecidedataruntime.

    14.Whatarethedifferentkindsofassemblies?

    Therecanbetwotypesofassemblies.

    i.)Staticassemblies

    Theyarestoredondiskinportableexecutablefiles.Itincludes.NETFrameworktypeslikeinterfacesandclasses,resourcesfortheassembly(bitmaps,JPEGfiles,resourcefilesetc.).

    ii.)Dynamicassemblies

    Theyarenotsavedondiskbeforeexecutionrathertheyrundirectlyfrommemory.Theycanbesavedtodiskaftertheyhavebeenexecuted.

    15.DifferentiatebetweenStructureandClass.

  • StructuresarevaluetypewhileClassesarereferencetype.StructurescannothaveconstructorordestructorswhileClassescanhavethem.StructuresdonotsupportInheritancewhileClassesdosupportInheritance.

    16.ExplainViewState.

    Itisa.Netmechanismtostoretheposteddataamongpostbacks.Itallowsthestateofobjectstobestoredinahiddenfieldonthepage,savedonclientsideandtransportedbacktoserverwheneverrequired.

    17.WhatarethevarioustypesofAuthentication?

    Thereare3typesofAuthenticationnamelyWindows,FormsandPassportAuthentication.

    WindowsauthenticationItusesthesecurityfeaturesintegratedinWindowsNTandWindowsXPOStoauthenticateandauthorizeWebapplicationusers.

    FormsauthenticationItallowsyoutocreateyourownlistofusersandvalidatetheiridentitywhentheyvisittheWebsite.

    PassportauthenticationItusestheMicrosoftcentralizedauthenticationprovidertoidentifyusers.PassportallowsuserstouseasingleidentityacrossmultipleWebapplications.PassportSDKneedstobeinstalledtousePassportauthenticationinyourWebapplication.

    18.ExplainServersidescriptingandClientsidescripting.

    ServersidescriptingAllthescriptareexecutedbytheserverandinterpretedasneeded.Clientsidescriptingmeansthatthescriptwillbeexecutedimmediatelyinthebrowsersuchasformfieldvalidation,emailvalidation,etc.ItisusaullaycarrriedoutinVBScriptorJavaScript.

    19.a.)Whatisgarbagecollection?

    Itisasystemwherearuntimecomponenttakesresponsibilityformanagingthelifetimeofobjectsandtheheapmemorythattheyoccupy.

    b.)Explainserializationanddeserialization.

    Serializationistheprocessofconvertinganobjectintoastreamofbytes.

  • Deserializationistheprocessofcreatinganobjectfromastreamofbytes.

    Boththeseprocessesareusuallyusedtotransportobjects.

    20.WhatarethevarioussessionstatemanagementoptionsprovidedbyASP.NET?

    ASP.NETprovidestwosessionstatemanagementoptionsInProcessandOutofProcessstatemanagement.InProcessstoresthesessioninmemoryonthewebserver.OutofProcessstoresdatainanexternaldatasource.ThisdatasourcemaybeaSQLServeroraStateServerservice.OutofProcessstatemanagementneedsallobjectsstoredinsessiontobeserializable.

    ASP.NETinterviewquestionsJan04,2011at05:16PMbyRahul

    DescribehowPassportauthenticationworks.

    ASP.NETapplicationwithPassportauthenticationimplementedcheckstheusersmachineforacurrentpassportauthenticationcookie.Ifitisnotavailable,ASP.NETdirectstheusertoaPassportsignonpage.ThePassportserviceauthenticatestheuser,storesanauthenticationcookieontheuserscomputeranddirecttheusertotherequestedpage.

    ExplainthestepstobefollowedtousePassportauthentication.

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

    ExplaintheadvantagesofPassportauthentication.

    UserdoesnthavetorememberseparateusernamesandpasswordsforvariousWebsitesUsercanmaintainhisorherprofileinformationinasinglelocation.PassportauthenticationalsoavailaccesstovariousMicrosoftservices,suchasPassportExpressPurchase.

    Whatiscaching?

    Cachingisthetechniqueofstoringfrequentlyuseditemsinmemorysothattheycanbeaccessedmorequickly.Bycachingtheresponse,therequestisservedfromtheresponsealreadystoredinmemory.

  • ItsimportanttochoosetheitemstocachewiselyasCachingincursoverhead.AWebformthatisfrequentlyusedanddoesnotcontaindatathatfrequentlychangesisgoodforcaching.Acachedwebformfreezesformsserversidecontentandchangestothatcontentdonotappearuntilthecacheisrefreshed.

    AdvancedAsp.netinterviewquestionsASP.NETpracticetest

    Explaintheuseofdurationattributeof@OutputCachepagedirective.

    The@OutputCachedirectivesDurationattributedetermineshowlongthepageiscached.Ifthedurationattributeissetto60seconds,theWebformiscachedfor60secondstheserverloadstheresponseinmemoryandretainsthatresponsefor60seconds.Anyrequestsduringthattimereceivethecachedresponse.Oncethecachedurationhasexpired,thenextrequestgeneratesanewresponseandcachedforanother60seconds.

    ASP.NETinterviewtest(20questions)newASP.NETinterviewtestforexperienced(19questions)SqlServer(25questions)

    1.Explainhowawebapplicationworks.

    Answer:

    Awebapplicationresidesintheserverandservestheclient'srequestsoverinternet.Theclientaccessthewebpageusingbrowserfromhismachine.Whenaclientmakesarequest,itreceivestheresultintheformofHTMLwhichareinterpretedanddisplayedbythebrowser.

    AwebapplicationontheserversiderunsunderthemanagementofMicrosoftInternetInformationServices(IIS).IISpassestherequestreceivedfromclienttotheapplication.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.

    ContentfilesContentfilesincludestatictext,imagesandcanincludeelementsfromdatabase.

    ProgramlogicProgramlogicfilesexistasDLLfileontheserverthatrespondstotheuseractions.

    Configurationfile

  • Configurationfileoffersvarioussettingsthatdeterminehowtheapplicationrunsontheserver.

    4.DescribethesequenceofactiontakesplaceontheserverwhenASP.NETapplicationstartsfirsttime

    Answer:

    Followingarethesequences:

    IISstartsASP.NETworkerprocessworkerprocessloadsassemblyinthememoryIISsendstherequesttotheassemblytheassemblycomposesaresponseusingprogramlogicIISreturnstheresponsetotheuserintheformofHTML.

    5.ExplainthecomponentsofwebforminASP.NET

    Answer:

    ServercontrolsTheservercontrolsareHypertextMarkupLanguage(HTML)elementsthatincludearunat=serverattribute.Theyprovideautomaticstatemanagementandserversideeventsandrespondtotheusereventsbyexecutingeventhandlerontheserver.

    HTMLcontrolsThesecontrolsalsorespondtotheusereventsbuttheeventsprocessinghappenontheclientmachine.

    DatacontrolsDatacontrolsallowtoconnecttothedatabase,executecommandandretrievedatafromdatabase.

    SystemcomponentsSystemcomponentsprovideaccesstosystemleveleventsthatoccurontheserver.

    6.Describeinbrief.NETFrameworkanditscomponents.

    Answer:

    .NETFrameworkprovidesplatformfordevelopingwindowsandwebsoftware.ASP.NETisapartof.NetframeworkandcanaccessallfeaturesimplementedwithinitthatwasformerlyavailableonlythroughwindowsAPI..NETFrameworksitsinbetweenourapplicationprogramsandoperatingsystem.

  • The.NetFrameworkhastwomaincomponents:

    .NetFrameworkClassLibrary:Itprovidescommontypessuchasdatatypesandobjecttypesthatcanbesharedbyall.Netcompliantlanguage.

    TheCommonlanguageRuntime:Itprovidesservicesliketypesafety,security,codeexecution,threadmanagement,interoperabilityservices.

    7.WhatisanAssembly?Explainitsparts

    Answer:

    Anassemblyexistsasa.DLLor.EXEthatcontainsMSILcodethatisexecutedbyCLR.Anassemblycontainsinterfaceandclasses,itcanalsocontainotherresourceslikebitmaps,filesetc.ItcarriesversiondetailswhichareusedbytheCLRduringexecution.Twoassembliesofthesamenamebutwithdifferentversionscanrunsidebysideenablingapplicationsthatdependonaspecificversiontouseassemblyofthatversion.Anassemblyistheunitonwhichpermissionsaregranted.Itcanbeprivateorglobal.Aprivateassemblyisusedonlybytheapplicationtowhichitbelongs,buttheglobalassemblycanbeusedbyanyapplicationinthesystem.

    Thefourpartsofanassemblyare:

    AssemblyManifestItcontainsname,version,culture,andinformationaboutreferencedassemblies.

    TypemetadataItcontainsinformationabouttypesdefinedintheassembly.

    MSILMSILcode.

    ResourcesFilessuchasBMPorJPGfileoranyotherfilesrequiredbyapplication.

    8.DefineCommonTypeSystem.

    Answer:

    .Netallowsdeveloperstowriteprogramlogicinatleast25languages.Theclasseswritteninonelanguagecanbeusedbyotherlanguagesin.Net.Thisserviceof.NetispossiblethroughCTSwhichensuretherulesrelatedtodatatypesthatalllanguagemustfollow.Itprovidessetoftypesthatareusedbyall.NETlanguagesandensures.NETlanguagetypecompatibility.

  • 9.DefineVirtualfolder.

    Answer:

    Itisthefolderthatcontainswebapplications.ThefolderthathasbeenpublishedasvirtualfolderbyIIScanonlycontainwebapplications.

    10.DescribetheEventsintheLifeCycleofaWebApplication

    Answer:

    Awebapplicationstartswhenabrowserrequestsapageoftheapplicationfirsttime.TherequestisreceivedbytheIISwhichthenstartsASP.NETworkerprocess(aspnet_wp.exe).Theworkerprocessthenallocatesaprocessspacetotheassemblyandloadsit.Anapplication_starteventoccursfollowedbySession_start.TherequestisthenprocessedbytheASP.NETengineandsendsbackresponseintheformofHTML.Theuserreceivestheresponseintheformofpage.

    Thepagecanbesubmittedtotheserverforfurtherprocessing.Thepagesubmittingtriggerspostbackeventthatcausesthebrowsertosendthepagedata,alsocalledasviewstatetotheserver.Whenserverreceivesviewstate,itcreatesnewinstanceofthewebform.ThedataisthenrestoredfromtheviewstatetothecontrolofthewebforminPage_Initevent.

    ThedatainthecontrolisthenavailableinthePage_loadeventofthewebform.Thecachedeventisthenhandledandfinallytheeventthatcausedthepostbackisprocessed.Thewebformisthendestroyed.Whentheuserstopsusingtheapplication,Session_endeventoccursandsessionends.Thedefaultsessiontimeis20minutes.TheapplicationendswhennouseraccessingtheapplicationandthistriggersApplication_Endevent.FinallyalltheresourcesoftheapplicationarereclaimedbytheGarbagecollector.

    11.WhatarethewaysofpreservingdataonaWebForminASP.NET?

    Answer:

    ASP.NEThasintroducedviewstatetopreservedatabetweenpostbackevents.Viewstatecan'tavaildatatootherwebforminanapplication.Toprovidedatatootherforms,youneedtosavedatainastatevariableintheapplicationorsessionobjects.

    12.Defineapplicationstatevariableandsessionstatevariable.

    Answer:

  • Theseobjectsprovidetwolevelsofscope:

    ApplicationStateDatastoredintheapplicationobjectcanbesharedbyallthesessionsoftheapplication.Applicationobjectstoresdatainthekeyvaluepair.

    SessionStateSessionStatestoressessionspecificinformationandtheinformationisvisiblewithinthesessiononly.ASP.NETcreatesuniquesessionIdforeachsessionoftheapplication.SessionIDsaremaintainedeitherbyanHTTPcookieoramodifiedURL,assetintheapplicationsconfigurationsettings.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_InitPage_LoadPage_PreRenderPage_UnloadPage_DisposedPage_ErrorPage_AbortTransactionPage_CommitTransaction

  • Page_DataBinding

    15.DescribetheServerControlEventsofASP.NET.

    Answer:

    ASP.NEToffersmanyservercontrolslikebutton,textbox,DropDownListetc.Eachcontrolcanrespondtotheuser'sactionsusingeventsandeventhandlermechanism.

    Therearethreetypesofservercontrolevents:

    PostbackeventsThiseventssendsthewebpagetotheserverforprocessing.Webpagesendsdatabacktothesamepageontheserver.

    CachedeventsTheseeventsareprocessedwhenapostbackeventoccurs.

    ValidationeventsTheseeventsoccurjustbeforeapageispostedbacktotheserver.

    16.Howdoyouchangethesessiontimeoutvalue?

    Answer:

    Thesessiontimeoutvalueisspecifiedintheweb.configfilewithinsessionstateelement.Youcanchangethesessiontimeoutsettingbychangingvalueoftimeoutattributeofsessionstateelementinweb.configfile.

    17.DescribehowASP.NETmaintainsprocessisolationforeachWebapplication

    Answer:

    InASP.NET,whenIISreceivesarequest,IISusesaspnet_isapi.dlltocalltheASP.NETworkerprocess(aspnet_wp.exe).TheASP.NETworkerprocessloadstheWebapplication'sassembly,allocatingoneprocessspace,calledtheapplicationdomain,foreachapplication.ThisisthehowASP.NETmaintainsprocessisolationforeachWebapplication.

    18.Definenamespace.

  • Answer:

    Namespacesarethewaytoorganizeprogrammingcode.Itremovesthechancesofnameconflict.Itisquitepossibletohaveonenameforanitemaccidentallyinlargeprojectsthoseresultsintoconflict.Byorganizingyourcodeintonamespaces,youreducethechanceoftheseconflicts.YoucancreatenamespacesbyenclosingaclassinaNamespace...EndNamespaceblock.

    YoucanusenamespacesoutsideyourprojectbyreferringthemusingReferencesdialogbox.YoucanuseImportsorusingstatementtothecodefiletoaccessmembersofthenamespacesincode.

    19.WhataretheoptionsinASP.NETtomaintainstate?

    Answer:

    ClientsidestatemanagementThismaintainsinformationontheclientsmachineusingCookies,ViewState,andQueryStrings.

    CookiesAcookieisasmalltextfileontheclientmachineeitherintheclientsfilesystemormemoryofclientbrowsersession.Cookiesarenotgoodforsensitivedata.Moreover,Cookiescanbedisabledonthebrowser.Thus,youcantrelyoncookiesforstatemanagement.

    ViewStateEachpageandeachcontrolonthepagehasViewStateproperty.Thispropertyallowsautomaticretentionofpageandcontrolsstatebetweeneachtriptoserver.Thismeanscontrolvalueismaintainedbetweenpagepostbacks.Viewstateisimplementedusing_VIEWSTATE,ahiddenformfieldwhichgetscreatedautomaticallyoneachpage.Youcanttransmitdatatootherpageusingviewstate.

    QuerystringQuerystringscanmaintainlimitedstateinformation.DatacanbepassedfromonepagetoanotherwiththeURLbutyoucansendlimitedsizeofdatawiththeURL.Mostbrowsersallowalimitof255charactersonURLlength.

    ServersidestatemanagementThiskindofmechanismretainsstateintheserver.

    ApplicationState

  • Thedatastoredintheapplicationobjectcanbesharedbyallthesessionsoftheapplication.Applicationobjectstoresdatainthekeyvaluepair.

    SessionStateSessionStatestoressessionspecificinformationandtheinformationisvisiblewithinthesessiononly.ASP.NETcreatesuniquesessionIdforeachsessionoftheapplication.SessionIDsaremaintainedeitherbyanHTTPcookieoramodifiedURL,assetintheapplicationsconfigurationsettings.Bydefault,SessionIDvaluesarestoredinacookie.

    DatabaseDatabasecanbeusedtostorelargestateinformation.Databasesupportisusedincombinationwithcookiesorsessionstate.

    20.ExplainthedifferencebetweenServercontrolandHTMLcontrol.

    Answer:

    ServereventsServercontroleventsarehandledintheserverwhereasHTMLcontroleventsarehandledinthepage.

    StatemanagementServercontrolscanmaintaindataacrossrequestsusingviewstatewhereasHTMLcontrolshavenosuchmechanismtostoredatabetweenrequests.

    BrowserdetectionServercontrolscandetectbrowserautomaticallyandadaptdisplayofcontrolaccordinglywhereasHTMLcontrolscantdetectbrowserautomatically.

    PropertiesServercontrolscontainpropertieswhereasHTMLcontrolshaveattributesonly.

    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:

    HyperlinkcontrolResponse.RedirectmethodServer.TransfermethodServer.ExecutemethodWindow.Openscriptmethod

    24.Howdoyouopenapageinanewwindow?

  • Answer:

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

    25.Defineauthenticationandauthorization.

    Answer:

    Authorization:Theprocessofgrantingaccessprivilegestoresourcesortaskswithinanapplication.

    Authentication:Theprocessofvalidatingtheidentityofauser.

    26.Definecaching.

    Answer:

    Cachingisthetechniqueofstoringfrequentlyuseditemsinmemorysothattheycanbeaccessedmorequickly.Cachingtechniqueallowstostore/cachepageoutputorapplicationdataontheclientontheserver.Thecachedinformationisusedtoservesubsequentrequeststhatavoidtheoverheadofrecreatingthesameinformation.Thisenhancesperformancewhensameinformationisrequestedmanytimesbytheuser.

    27.Definecookie.

    Answer:

    Acookieisasmallfileontheclientcomputerthatawebapplicationusestomaintaincurrentsessioninformation.Cookiesareusedtoidentityauserinafuturesession.

    28.Whatisdelegate?

    Answer:

    Adelegateactslikeastronglytypefunctionpointer.Delegatescaninvokethemethodsthattheyreferencewithoutmakingexplicitcallstothosemethods.Itistypesafesinceitholdsreferenceofonlythosemethodsthatmatchitssignature.Unlikeotherclasses,thedelegateclasshasasignature.Delegatesareusedtoimplementeventprogrammingmodelin.NETapplication.Delegatesenablethemethodsthatlistenforanevent,tobeabstract.

    29.ExplainExceptionhandlingin.Net.

  • Answer:Exceptionsorerrorsareunusualoccurrencesthathappenwithinthelogicofanapplication.TheCLRhasprovidedstructuredwaytodealwithexceptionsusingTry/Catchblock.ASP.NETsupportssomefacilitiestohandlingexceptionsusingeventssuckasPage_ErrorandApplication_Error.

    30.Whatisimpersonation?

    Answer:

    Impersonationmeansdelegatingoneuseridentitytoanotheruser.InASP.NET,theanonymoususersimpersonatetheASPNETuseraccountbydefault.Youcanuseelementofweb.configfiletoimpersonateuser.E.g.

    31.Whatismanagedcodein.Net?

    Answer:

    Thecodethatrunsundertheguidanceofcommonlanguageruntime(CLR)iscalledmanagedcode.Theversioningandregistrationproblemwhichareformallyhandledbythewindowsprogrammingaresolvedin.Netwiththeintroductionofmanagedcode.ThemanagedcodecontainsalltheversioningandtypeinformationthattheCLRusetoruntheapplication.

    32.WhatareMergemodules?

    Answer:

    Mergemodulesarethedeploymentprojectsforthesharedcomponents.Ifthecomponentsarealreadyinstalled,themodulesmergethechangesratherthanunnecessarilyoverwritethem.Whenthecomponentsarenolongerinuse,theyareremovedsafelyfromtheserverusingMergemodulesfacility.

    33.WhatisSatelliteassembly?

    Answer:

    Satelliteassemblyisakindofassemblythatincludeslocalizedresourcesforanapplication.Eachsatelliteassemblycontainstheresourcesforoneculture.

    34.Definesecuredsocketslayer.

    Answer:

  • SecuredSocketLayer(SSL)ensuresasecuredwebapplicationbyencryptingthedatasentoverinternet.WhenanapplicationisusingSSLfacility,theservergeneratesanencryptionkeyforthesessionandpageisencryptedbeforeitsent.TheclientbrowseusesthisencryptionkeytodecrypttherequestedWebpage.

    35.DefinesessioninASP.NET.

    Answer:

    Asessionstartswhenthebrowserfirstrequestaresourcesfromwithintheapplication.Thesessiongetsterminatedwheneitherbrowsercloseddownorsessiontimeouthasbeenattained.Thedefaulttimeoutforthesessionis20minutes.

    36.DefineTracing.

    Answer:

    Tracingisthewaytomaintaineventsinanapplication.Itisusefulwhiletheapplicationisindebuggingorinthetestingphase.Thetraceclassinthecodeisusedtodiagnoseproblem.Youcanusetracemessagestoyourprojecttomonitoreventsinthereleasedversionoftheapplication.ThetraceclassisfoundintheSystem.Diagnosticsnamespace.ASP.NETintroducestracingthatenablesyoutowritedebugstatementsinyourcode,whichstillremaininthecodeevenafterwhenitisdeployedtoproductionservers.

    37.DefineViewState.

    Answer:

    ASP.NETpreservesdatabetweenpostbackeventsusingviewstate.Youcansavealotofcodingusingviewstateinthewebform.ViewStateserializethestateofobjectsandstoreinahiddenfieldonthepage.Itretainsthestateofserversideobjectsbetweenpostbacks.Itrepresentsthestatusofthepagewhensubmittedtotheserver.Bydefault,viewstateismaintainedforeachpage.IfyoudonotwanttomaintaintheViewState,includethedirectiveatthetopofan.aspxpageoraddtheattributeEnableViewState="false"toanycontrol.ViewStateexistforthelifeofthecurrentpage.

    38.Whatisapplicationdomain?

    Answer:

    ItistheprocessspacewithinwhichASP.NETapplicationruns.Everyapplicationhasitsownprocessspacewhichisolatesitfromotherapplication.Ifoneoftheapplicationdomainsthrowserroritdoesnotaffecttheotherapplicationdomains.

  • 39.Listdownthesequenceofmethodscalledduringthepageload.

    Answer:

    Init()Initializesthepage.Load()Loadsthepageintheservermemory.PreRender()thebriefmomentbeforethepageisdisplayedtotheuserasHTMLUnload()runsjustafterpagefinishesloading.

    40.WhatistheimportanceofGlobal.asaxinASP.NET?

    Answer:

    TheGlobal.asaxisusedtoimplementapplicationandsessionlevelevents.

    41.DefineMSIL.

    Answer:

    MSIListheMicrosoftIntermediateLanguage.All.Netlanguages'executableexistsasMSILwhichgetsconvertedintomachinespecificlanguageusingJITcompilerjustbeforeexecution.

    42.Response.RedirectvsServer.Transfer

    Answer:

    Server.Transferisonlyapplicableforaspxfiles.Ittransferspageprocessingtoanotherpagewithoutmakingroundtripbacktotheclient'sbrowser.Sincenoroundtrips,itoffersfasterresponseanddoesn'tupdateclienturlhistorylist.

    Response.Redirectisusedtoredirecttoanotherpageorsite.Thisperformsatripbacktotheclientwheretheclientsbrowserisredirectedtothenewpage.

    43.ExplainSessionstatemanagementoptionsinASP.NET.Answer:

    ASP.NETprovidesInProcessandOutofProcessstatemanagement.InProcessstoresthesessioninmemoryonthewebserver.OutofProcessSessionstatemanagementstoresdatainanexternaldatasourcesuchasSQLServeroraStateServerservice.

  • OutofProcessstatemanagementrequiresthatallobjectsstoredinsessionareserializable.

    44.Howtoturnoffcookiesforapage?

    Answer:

    Cookie.DiscardPropertywhentrue,instructstheclientapplicationnottosavetheCookieontheuser'sharddiskwhenasessionends.

    45.Howcanyouensureapermanentcookie?

    Answer:

    SettingExpirespropertytoMinValueandrestrictcookietogetexpired.

    46.WhatisAutoPostback?

    Answer:

    AutoPostBackautomaticallypoststhepagebacktotheserverwhenstateofthecontrolischanged.

    47.Explainlogincontrolandformauthentication.

    Answer:

    LogincontrolsencapsulateallthefeaturesofferedbyFormsauthentication.LogincontrolsinternallyuseFormsAuthenticationclasstoimplementsecuritybypromptingforusercredentialsvalidatingthem.

    48.WhatistheuseofWeb.configfile?

    Answer:

    Followingarethesettingyoucanincorporateinweb.configfile.

    DatabaseconnectionsErrorPagesettingSessionStatesErrorHandling

  • SecurityTracesettingCulturespecificsetting

    49.Explaininwhatorderadestructorsiscalled.

    Answer:

    Destructorsarecalledinreverseorderofconstructors.Destructorofmostderivedclassiscalledfollowedbyitsparent'sdestructorandsoontillthetopmostclassinthehierarchy.

    50.Whatisbreakmode?Whataretheoptionstostepthroughcode?

    Answer:

    Breakmodeletsyoutoobservecodelinetolineinordertolocateerror.VS.NETprovidesfollowingoptiontostepthroughcode.

    StepIntoStepOverStepOutRunToCursorSetNextStatement

    51.ExplainhowtoretrievepropertysettingsfromXML.configfile.

    Answer:

    CreateaninstanceofAppSettingsReaderclass,useGetValuemethodbypassingthenameofthepropertyandthetypeexpected.Assigntheresulttotheappropriatevariable.

    52.ExplainGlobalAssemblyCache.

    Answer:

    GlobalAssemblyCacheistheplaceholderforsharedassembly.IfanassemblyisinstalledtotheGlobalAssemblyCache,theassemblycanbeaccessedbymultipleapplications.InordertoinstallanassemblytotheGAC,theassemblymusthavetobesignedwithstrongname.

  • 53.ExplainManagedcodeanUnmanagedcode.

    Answer:

    Managedcoderunsunderthesafesupervisionofcommonlanguageruntime.Managedcodecarriesmetadatathatisusedbycommonlanguageruntimetoofferservicelikememorymanagement,codeaccesssecurity,andcrosslanguageaccessibility.

    Unmanagedcodedoesn'tfollowCLRconventionsandthus,can'ttaketheadvantagesof.Framework.

    54.Whatissidebysideexecution?

    Answer:

    Thismeansmultipleversionofsameassemblytorunonthesamecomputer.Thisfeatureenablestodeploymultipleversionsofthecomponent.

    55.DefineResourceFiles.

    Answer:

    Resourcefilescontainsnonexecutabledatalikestrings,imagesetcthatareusedbyanapplicationanddeployedalongwithit.Youcanchangesthesedatawithoutrecompilingthewholeapplication.

    56.DefineGlobalizationandLocalization.

    Answer:

    Globalizationistheprocessofcreatingmultilingualapplicationbydefiningculturespecificfeatureslikecurrency,dateandtimeformat,calendarandotherissues.Localizationistheprocessofaccommodatingculturaldifferencesinanapplication.

    57.Whatisreflection?Answer:

    Reflectionisamechanismthroughwhichtypesdefinedinthemetadataofeachmodulecanbeaccessed.TheSystem.Reflectionnamespacescontainsclassesthatcanbeusedtodefinethetypesforanassembly.

    58.DefineSatelliteAssemblies.

  • Answer:

    SatelliteAssembliesarethespecialkindsofassembliesthatexistasDLLandcontainculturespecificresourcesinabinaryformat.Theystorecompiledlocalizedapplicationresources.TheycanbecreatedusingtheALutilityandcanbedeployedevenafterdeploymentoftheapplication.SatelliteAssembliesencapsulateresourcesintobinaryformatandthusmakesresourceslighterandconsumelesserspaceonthedisk.

    59.WhatisCAS?

    Answer:

    CASisveryimportantpartof.Netsecuritysystemwhichverifiesifparticularpieceofcodeisallowedtorun.Italsodeterminesifpieceofcodehaveaccessrightstorunparticularresource..NETsecuritysystemappliesthesefeaturesusingcodegroupsandpermissions.Eachassemblyofanapplicationisthepartofcodegroupwithassociatedpermissions.

    60.ExplainAutomaticMemoryManagementin.NET.

    Answer:

    Automaticmemorymanagementin.Netisthroughgarbagecollectorwhichisincrediblyefficientinreleasingresourceswhennolongerinuse.