ASP.NET_C#_WebServices Related questions.doc

download ASP.NET_C#_WebServices Related questions.doc

of 7

Transcript of ASP.NET_C#_WebServices Related questions.doc

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    1/7

    ASP.NET Questions

    ASP.NET is a sophisticated engine using Managed Code for front to back processing of Web Requests.

    Part.

    .!escribe the ro"e of inetinfo.e#e$ aspnet%isapi.d"" andaspnet%&p.e#e in the page "oading process.inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is receivedusuall! a file "ith .as#x extension$, the ISAPI filter as#net%isa#i.dll ta&es care of it '! #assing the request tothe actual "or&er #rocessas#net%"#.exe.'.What(s the difference bet&een Response.Write)* andResponse.+utput.Write)*,(es#onse.)ut#ut.Write$ allo"s !ou to "rite formatted out#ut.

    -.What ethods are fired during the page "oad,Init$ * "hen the #age is instantiated+oad$ * "hen the #age is loaded into server memor!Pre(ender$ * the 'rief moment 'efore the #age is dis#la!ed to the user as TM+-nload$ * "hen #age finishes loading.

    /.When during the page processing c0c"e is 1ie&State a2ai"ab"e,After the Init$ and 'efore the Page%+oad$, or )n+oad$ for a control.

    3.What naespace does the Web page be"ong in the .NET 4rae&ork c"ass hierarch0,S!stem.We'.-I.Page

    5.Where do 0ou store the inforation about the user(s "oca"e,S!stem.We'.-I.Page.ulture

    6.What(s the difference bet&een Codebehind78M0Code.asp#.cs8 andSrc78M0Code.asp#.cs8,ode/ehind is relevant to 0isual Studio.NET onl!.

    9.What(s a bubb"ed e2ent,When !ou have a com#lex control, li&e 1ata2rid, "riting an event #rocessing routine for each o'3ect cell, 'utton, ro", etc.$ is quitetedious. The controls can 'u''le u# their eventhandlers, allo"ing the main 1ata2rid event handler to ta&e care of its constituents.

    :.Suppose 0ou &ant a certain ASP.NET function e#ecuted on Mouse+2er for a certain button. Where do 0ou add an e2enthand"er,

    Add an )nMouse)ver attri'ute to the 'utton. Exam#le4 'tnSu'mit.Attri'utes.Add5onmouseover5,5somelientodeere$65$6

    ;.What data t0pes do the Range1a"idator contro" support,

    Integer, String, and 1ate.

    .E#p"ain the differences bet&een Ser2er

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    2/7

    5.What is the ?"oba".asa# used for,The 2lo'al.asax including the 2lo'al.asax.cs file$ is used to im#lement a##lication and session level events.

    6.What are the App"ication%Start and Session%Start subroutines used for,This is "here !ou can set the s#ecific varia'les for the A##lication and Session o'3ects.

    9.Can 0ou e#p"ain &hat inheritance is and an e#ap"e of &hen 0ou ight use it,When !ou "ant to inherit use the functionalit! of$ another class. Exam#le4 With a 'ase class named Em#lo!ee, a Manager class could'e derived from the Em#lo!ee 'ase class.

    :.Whats an asseb"0,Assem'lies are the 'uilding 'loc&s of the .NET frame"or&. )vervie" of assem'lies from MS1N

    ';.!escribe the difference bet&een in"ine and code behind.Inline code "ritten along side the html in a #age. ode*'ehind is code "ritten in a se#arate file and referenced '! the .as#x #age.

    '.E#p"ain &hat a diffgra is$ and a good use for one,The 1iff2ram is one of the t"o

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    3/7

    State Manageent Questions.What is 1ie&State,0ie"State allo"s the state of o'3ects seriali>a'le$ to 'e stored in a hidden field on the #age. 0ie"State is trans#orted to the client and'ac& to the server, and is not stored on the server or an! other external source. 0ie"State is used the retain the state of server*sideo'3ects 'et"een #osta'ac&s.

    '.What is the "ifespan for ites stored in 1ie&State,Item stored in 0ie"State exist for the life of the current #age. This includes #ost'ac&s to the same #age$.

    -.What does the 8Enab"e1ie&State8 propert0 do, Wh0 &ou"d > &ant it on or off,It allo"s the #age to save the users in#ut on a form across #ost'ac&s. It saves the server*side values for a given control into 0ie"State"hich is stored as a hidden value on the #age 'efore sending the #age to the clients 'ro"ser. When the #age is #osted 'ac& to theserver the server control is recreated "ith the state stored in vie"state.

    /.What are the different t0pes of Session state anageent options a2ai"ab"e &ith ASP.NET,ASP.NET #rovides In*Process and )ut*of*Process state management. In*Process stores the session in memor! on the "e' server.This requires the a 5stic&!*server5 or no load*'alancing$ so that the user is al"a!s reconnected to the same "e' server. )ut*of*ProcesSession state management stores data in an external data source. The external data source ma! 'e either a S?+ Server or a StateServer service. )ut*of*Process state management requires that all o'3ects stored in session are seriali>a'le.

    Part'..E#p"ain the .NET architecture.

    The Microsoft .NET 4rae&orkis a soft"are com#onentthat is a #art of Microsoft Windo"s o#erating s!stems. It has a largeli'rar!o#re*coded solutions to common #rogram requirements, and manages the execution of #rograms "ritten s#ecificall! for the frame"or&.The .NET ;rame"or& is a &e!Microsoftoffering, and is intended to 'e used '! most ne" a##lications created for the Windo"s #latform

    The #re*coded solutions that form the frame"or&7s /ase lass +i'rar! cover a large range of #rogramming needs in areas including4user interface,data access,data'ase connectivit!,cr!#togra#h!,"e' a##lication develo#ment, numeric algorithms,and net"or&communications. The class li'rar! is used '! #rogrammers "ho com'ine it "ith their o"ncodeto #roduce a##lications.

    Programs "ritten for the .NET ;rame"or& execute in a soft"are environment that manages the #rogram7s runtimerequirements. Thisruntime environment, "hich is also a #art of the .NET ;rame"or&, is &no"n as the ommon +anguage (untime+($. The +(#rovides the a##earance of ana##lication virtual machine,so that #rogrammers need not consider the ca#a'ilities of the s#ecificP-that "ill execute the #rogram. The +( also #rovides other im#ortant services such as securit! mechanisms,memor! management, anexce#tion handling. The class li'rar! and the +( together com#ose the .NET ;rame"or&.

    '.o& an0 "anguages .NET is supporting no&,* When .NET "as introduced it came "ith several languages. 0/.NET, @, )/)+ and Perl, etc. The site 1otNet+anguages.Net sa!s languages are su##orted.

    -.o& is .NET ab"e to support u"tip"e "anguages,* a language should com#l! "ith the ommon +anguage (untime standard to 'ecome a .NET language. In .NET, code is com#iled toMicrosoft Intermediate +anguage MSI+ for short$. This is called as Managed ode. This Managed code is run in .NET environment. Soafter com#ilation to this I+ the language is not a 'arrier. A code can call or use a function "ritten in another language.

    /.o& ASP .NET different fro ASP,* Scri#ting is se#arated from the TM+, ode is com#iled as a 1++, these 1++s can 'e executed on the server.

    3.Resource 4i"esB o& to use the resource fi"es$ ho& to kno& &hich "anguage to use,

    5.What is sart na2igation,* The cursor #osition is maintained "hen the #age gets refreshed due to the server side validation and the #age gets refreshed.

    6.What is 2ie& state,* The "e' is stateless. /ut in ASP.NET, the state of a #age is maintained in the in the #age itself automaticall!. o"B The values areencr!#ted and saved in hidden controls. this is done automaticall! '! the ASP.NET. This can 'e s"itched off = on for a single control

    9.E#p"ain the "ife c0c"e of an ASP .NET page.

    :.o& do 0ou 2a"idate the contro"s in an ASP .NET page,* -sing s#ecial validation controls that are meant for this. We have (ange 0alidator, Email 0alidator.

    ;.Can the 2a"idation be done in the ser2er side, +r this can be done on"0 in the C"ient side,* lient side is done '! default. Server side validation is also #ossi'le. We can s"itch off the client side and server side can 'e done.

    .o& to anage pagination in a page,* -sing #agination o#tion in 1ata2rid control. We have to set the num'er of records for a #age, then it ta&es care of #agination '! itself

    http://en.wikipedia.org/wiki/Software_componentryhttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Library_(computing)http://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Base_Class_Libraryhttp://en.wikipedia.org/wiki/Programminghttp://en.wikipedia.org/wiki/Interface_(computer_science)http://en.wikipedia.org/wiki/Data_accesshttp://en.wikipedia.org/wiki/Database_Connectionhttp://en.wikipedia.org/wiki/Cryptographyhttp://en.wikipedia.org/wiki/Web_applicationhttp://en.wikipedia.org/wiki/Algorithmhttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Softwarehttp://en.wikipedia.org/wiki/Runtimehttp://en.wikipedia.org/wiki/Common_Language_Runtimehttp://en.wikipedia.org/wiki/Virtual_machine#Application_virtual_machinehttp://en.wikipedia.org/wiki/Central_Processing_Unithttp://en.wikipedia.org/wiki/Memory_managementhttp://en.wikipedia.org/wiki/Exception_handlinghttp://en.wikipedia.org/wiki/Software_componentryhttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Operating_systemhttp://en.wikipedia.org/wiki/Library_(computing)http://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Base_Class_Libraryhttp://en.wikipedia.org/wiki/Programminghttp://en.wikipedia.org/wiki/Interface_(computer_science)http://en.wikipedia.org/wiki/Data_accesshttp://en.wikipedia.org/wiki/Database_Connectionhttp://en.wikipedia.org/wiki/Cryptographyhttp://en.wikipedia.org/wiki/Web_applicationhttp://en.wikipedia.org/wiki/Algorithmhttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/Computer_networkinghttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Softwarehttp://en.wikipedia.org/wiki/Runtimehttp://en.wikipedia.org/wiki/Common_Language_Runtimehttp://en.wikipedia.org/wiki/Virtual_machine#Application_virtual_machinehttp://en.wikipedia.org/wiki/Central_Processing_Unithttp://en.wikipedia.org/wiki/Memory_managementhttp://en.wikipedia.org/wiki/Exception_handling
  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    4/7

    '.What is A!+ .NET and &hat is difference bet&een A!+ and A!+.NET,* A1).NET is stateless mechanism. I can treat the A1).Net as a se#arate in*memor! data'ase "here in I can use relationshi#s'et"een the ta'les and select insert and u#dates to the data'ase. I can u#date the actual data'ase as a 'atch.

    Tough ASP.NET inter2ie& questions

    .!escribe the difference bet&een a Thread and a Process,'.What is a Windo&s Ser2ice and ho& does its "ifec0c"e differ fro a .standard. EE,-.What is the a#iu aount of eor0 an0 sing"e process on Windo&s can address, >s this different than the a#iu2irtua" eor0 for the s0ste, o& &ou"d this affect a s0ste design,/.What is the difference bet&een an EE and a !@@,3.What is strongC"onab"e.'5.What is bo#ing,'6.>s string a 2a"ue t0pe or a reference t0pe,

    CK >nter2ie& Questions

    ?enera" Questions.

    .!oes CK support u"tip"e

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    5/7

    The lone$ method returns a ne" arra! a shallo" co#!$ o'3ect containing all the elements in the original arra!. The o#!To$ methodco#ies the elements into another existing arra!. /oth #erform a shallo" co#!. A shallo" co#! means the contents each arra! elementcontains references to the same o'3ect as the elements in the original arra!. A dee# co#! "hich neither of these methods #erforms$"ould create a ne" instance of each element7s o'3ect, resulting in a different, !et identacle o'3ect..o& can 0ou sort the e"eents of the arra0 in descending order,/! calling Sort$ and then (everse$ methods.

    '.What(s the .NET co""ection c"ass that a""o&s an e"eent to be accessed using a unique ke0,ashTa'le.

    -.What c"ass is underneath the Sorted@ist c"ass,A sorted ashTa'le.

    /.Wi"" the fina""0 b"ock get e#ecuted if an e#ception has not occurred,L:es.

    3.What(s the CK s0nta# to catch an0 possib"e e#ception,A catch 'loc& that catches the exce#tion of t!#e S!stem.Exce#tion. :ou can also omit the #arameter data t!#e in this case and 3ust"rite catch CD.

    5.Can u"tip"e catch b"ocks be e#ecuted for a sing"e tr0 stateent,No. )nce the #ro#er catch 'loc& #rocessed, control is transferred to the finall! 'loc& if there are an!$.

    6.E#p"ain the three ser2ices ode" coon"0 kno& as a three

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    6/7

    0alue. The data t!#e of the value #arameter is defined '! "hatever data t!#e the #ro#ert! is declared as.

    '.What does the ke0&ord F2irtua"G dec"are for a ethod or propert0,The method or #ro#ert! can 'e overridden.

    -.o& is ethod o2erriding different fro ethod o2er"oading,When overriding a method, !ou change the 'ehavior of the method for the derived class. )verloading a method sim#l! involves havinganother method "ith the same name "ithin the class.

    /.Can 0ou dec"are an o2erride ethod to be static if the origina" ethod is not static,No. The signature of the virtual method must remain the same. Note4 )nl! the &e!"ord virtual is changed to &e!"ord override$

    3.What are the different &a0s a ethod can be o2er"oaded,1ifferent #arameter data t!#es, different num'er of #arameters, different order of #arameters.

    5.>f a base c"ass has a nuber of o2er"oaded constructors$ and an inheriting c"ass has a nuber of o2er"oaded constructorscan 0ou enforce a ca"" fro an inherited constructor to a specific base constructor,:es, 3ust #lace a colon, and then &e!"ord 'ase #arameter list to invo&e the a##ro#riate constructor$ in the overloaded constructordefinition inside the inherited class.E2ents and !e"egates.What(s a de"egate,

    A delegate o'3ect enca#sulates a reference to a method.

    '.What(s a u"ticast de"egate,A delegate that has multi#le handlers assigned to it. Each assigned handler method$ is called.

    M@ !ocuentation Questions.>s M@ case

  • 8/13/2019 ASP.NET_C#_WebServices Related questions.doc

    7/7

    '.What are ad2antages and disad2antages of Microsoft! ru"e of thub for transactions.A transaction must 'e4G. Atomic * it is one unit of "or& and does not de#endent on #revious and follo"ing transactions.H. onsistent * data is either committed or roll 'ac&, no in*'et"eenF case "here something has 'een u#dated and something hasnK. Isolated * no transaction sees the intermediate results of the current transaction$.. 1ura'le * the values #ersist if the data had 'een committed even if the s!stem crashes right after.

    3.What connections does Microsoft SQ@ Ser2er support,Windo"s Authentication via Active 1irector!$ and S?+ Server authentication via Microsoft S?+ Server username and #ass"ord$.

    5.=et&een Windo&s Authentication and SQ@ Ser2er Authentication$ &hich one is trusted and &hich one is untrustedBWindo"s Authentication is trusted 'ecause the username and #ass"ord are chec&ed "ith the Active 1irector!, the S?+ Serverauthentication is untrusted, since S?+ Server is the onl! verifier #artici#ating in the transaction.

    6.What does the >nitia" Cata"og paraeter define in the connection string,The data'ase name to connect to.

    9.What does the !ispose ethod do &ith the connection obJect,1eletes it from the memor!.To 1o4 ans"er 'etter. The current ans"er is not entirel! correct.

    :.What is a pre