Sunteți pe pagina 1din 25

What are the advantages of using ASP?

HTML is used only to create static web pages (which display information) with the
use of ASP one can create dynamic web pages, where client can communicate with
the web serer and ice ersa! Thus using ASP interactie "ebPages can be
created!
What is the maximum data can be sent as a query string?
Ma#imum length is $%&' in ()!!!
what are the tools used for editing in IIS?
((S Metabase )#plorer is a freeware tool to allow editing of the ((S metabase!
)ssentially this has a similar featureset to Microsoft*s Meta)dit and Metabase
)#plorer e#cept that it runs on all ersions of "indows from +& through to $%%,! (n
addition the software includes a trace window feature which allows you to trac- all
actiity in the metabase including ((S itself or any other administration tool!
What is connection pooling ?
A connection pool is a set of database connections that are aailable for an
application to use! .onnection Pooling is the concept of using a connection pool for
enhanced performance!
How many types of cooies are available in asp?
There are $ types of coo-ies Persistent and /on0persistent
What is http header?
HTTP headers e#pose a great deal of information about your client as well as the
serer you are wor-ing, the application you are designing, as well as the
enironment you are in (SSL, etc!)!The functionality for this is held in
12e3uest!Serer4ariables1, so you only need to access that! 5or e#ample,
2e3uest!Serer4ariables(1ALL6HTTP1) or
2e3uest!Serer4ariables(1HTTP67S)26A8)/T1)! 9ou need to -now the speci:c name
of the header that you want! (t is e#tremely simple to display all the HTTP headers
in ASP! Here*s a code snippit that will do it for you; < = for each header in
2e3uest!Serer4ariables response!write header > 1 ? 1 >
2e3uest!Serer4ariables(header) > 1 < br@< br@ 1 ne#t = @ Aust delete the spaces
near the angle brac-ets and run it on ((S! 9ou*ll get a list of all the HTTP headers
along with the actual alue for the header! Ma-e sure to try this with diBerent
browsers and on diBerent computers with diBerent operating systems if you can!
9ou*ll immediately see the diBerences!
What is the di!erence between Server"side validation and #lient"side
validation?
.lient side alidation is processed the client side before submitting the form! The
adantage of using the client side alidation is , it reduces the netor- tra:ic , since
the alidation is processed in the client machine itself! )g, email, isnumeric, isdate
etc!
Serer side alidation is processed in the serer! Some data cannot be alidated in
the client side and it has to be alidated in the serer side! )g, Cate between the
two dates in the database
How long is a SessionI$ guaranteed to be unique?
(t is uni3ue per client! A client cannot hae two sessions with the same Session(C!
Application(1connectionstring1) ? 1Proider?s3loledb!DECata Source?F28DDE
(nitial .atalog?SubletETrusted6.onnection?9esE7ser (d?saEPassword?miller',%GE1
Syntax for con to execute an query?
Set con ? .reateFbHect(1ACFCI!.onnection1)
con!Fpen Application(1.onnectionstring1)
cmd ? 1update tbl6supply set mult ?D where 7sername ? J####KL
con!)#ecute cmd
con!.lose()
Set con ? /othing
Syntax for record set?
%x&'
Sqlstr ? 1Select /otes from bloc-ip where ipaddress ? *'M!$,!MM!DKL
Set rs ? .reateFbHect(1ACFCI!2ecordset1)
rs!Fpen Sqlstr,Application(1.onnectionstring1)
(f not (rs!)F5 and rs!IF5) Then
bloc-$6ip ? 19es1 bloc-6ip$6notes ? rs(%)!4alue
)nd if
rs!.lose()
Set rs ? /othing
)#;$
SqlStr = "Select distinct UserName From RM_Supply order by username"
set rs = server.CreateObect!""#O#$.Recordset"%
rs.Open SqlStr& "pplication!"Connectionstrin'"%
i( not !rs.)OF and rs.$OF% t*en
do +*ile not rs.)OF
cid6str ? cid6str > rs(%) > 1N1
rs!Moe/e#t()
Loop
end if
rs!.lose()
set rs ? /othing
How to handle %rror in ASP?
7sing Fn )rror 2esume /e#t
What is the result of using (ption %xplicit?
All ariables must be dimensioned before use!
Which is the default Scripting )anguage on the client side?
HaaScript
How are scripts executed?
ASP proides scripting engines that e#ecute the corresponding scripting languages
on the serer side! Scripts should be encoded within the 1< =O! =1
%xplain the building blocs of #lient*Server?
The client side building bloc- runs the client side of the application! The serer side
building bloc- runs the serer side of the application!
%xplain the P(S+ , -%+ .ethod or %xplain the di!erence between them/
PFST M)THFC;
The PFST method generates a 5F2M collection, which is sent as a HTTP re3uest
body! All the alues typed in the form will be stored in the 5F2M collection!
8)T M)THFC;
The 8)T method sends information by appending it to the 72L (with a 3uestion
mar-) and stored as A Puerystring collection! The Puerystring collection is passed
to the serer as nameQalue pair! The length of the 72L should be less than $MM
characters
What is a session?
A user accessing an application is -nown as a session!
What are the advantages of using ASP?
MinimiRes networ- traSc by limiting the need for the browser and serer to tal- to
each other!
Ma-es for 3uic-er loading time since HTML pages are only downloaded!
Allows to run programs in languages that are not supported by the browser!
.an proide the client with data that does not reside on the clientKs machine!
Proides improed security measures since the script cannot be iewed by the
browser!
What is ASP?
ASP stands for Actie Serer Pages! (t is a serer side technology which is
used to display dynamic content on web pages! 5or e#ample you could write
code that would gie your isitors diBerent information, diBerent images or
een a totally diBerent page depending on what browser ersion they are
using!
How can you disable the browser to view the code?
"riting codes within the Tag
0uestion What is a 12irtual $irectory1?
4irtual directories are aliases for directory paths on the serer! (t allows
moing :les on the dis- between diBerent folders, dries or een serers
without changing the structure of web pages! (t aoids typing an e#tremely
long 72L each time to access an ASP page!
-ive the comment +ags for the following?
4IScript ; 2)M > J(apostrophe)
AaaScript ; QQ (single line comment)
QT TQ (Multi0line comments)
Which is the default Scripting )anguage of ASP 3server"side4?
4IScript
Which is the default $ata types in 25Script?
4ariant is the default data type in 4IScript, which can store a alue of any
type!
What is a variable?
4ariable is a memory location through which the actual alues are
storedQretrieed! (ts alue can be changed!
What is the maximum si6e of an array?
7p to G% dimensions!
What is 0uerystring collection?
This collection stores any alues that are proided in the 72L! This can be
generated by three methods;
Iy clic-ing on an anchor tag
Iy sending a form to the serer by the 8)T method
Through user0typed HTTP address
(t allows you to e#tract data sent to the serer using a 8)T re3uest!
What are the attributes of the tags? What are their functions?
The two attributes are A.T(F/ and M)THFC
The A.T(F/ gies the name of the ASP :le that should be opened ne#t by
which this :le can access the information gien in the form The M)THFC
determines which of the two ways (PFST or 8)T) the browser can send the
information to the serer
What are the event handlers of Session (b7ect?
Application6FnStart U This eent will be :red when the :rst isitor hits the page!
Application6Fn)nd U This eent runs when the serer is stopped
What are the methods in Session (b7ect?
The Session FbHect has only one method, which is Abandon! (t destroys all
the obHects stored in a Session FbHect and releases the serer resources they
occupied!
What is Server2ariables collection?
The Serer4ariables collection holds the entire HTTP headers and also
additional items of information about the serer!
What is the di!erence between 0uerystring collection and 8orm
collection?
The main diBerence is that the Puerystring collection gets appended to a
72L!
What is a 8orm collection?
The 5orm collection holds the alues of the form elements submitted with the
PFST method! This is the only way to generate a 5orm collection!
What are the ASP Scripting (b7ects?
The Cictionary obHect, the 5ileSystemFbHect obHect, Te#tStream obHect!
What happens to a H+.) page?
The browser ma-es a HTTP re3uestE the serer gies a HTTP response to the
browser and the browser conerts into a HTML page!
What happens to ASP pages?
The browser ma-es a HTTP re3uestE the serer does the processing and gies
a HTML response to the browser!
How can you change the primary scripting language for a page?
Specify
What is application (b7ect?
Shares information among users of an application! 8ies a noti:cation when
an application starts or ends!
What is the di!erence between client"side script and server"side
script?
Scripts e#ecuted only by the browser without contacting the serer is called
client0side script! (t is browser dependent! The scripting code is isible to the
user and hence not secure! Scripts e#ecuted by the web serer and
processed by the serer is called serer0side script!
What is the command to display characters to the H+.) page?
2esponse!"rite
)#plain the PFST > 8)T Method or )#plain the diBerence between themV
PFST M)THFC;
The PFST method generates a 5F2M collection, which is sent as a HTTP
re3uest body! All the alues typed in the form will be stored in the 5F2M
collection!
8)T M)THFC;
The 8)T method sends information by appending it to the 72L (with a
3uestion mar-) and stored as A Puerystring collection! The Puerystring
collection is passed to the serer as nameQalue pair!
The length of the 72L should be less than $MM characters!
How many global!asa :les can an Application haeV
Fnly one global!asa :le and itKs placed in the irtual directoryKs root!
How many global!asa :les can an Application haeV
Fnly one global!asa :le and itKs placed in the irtual directoryKs root!
"hat are Scripting FbHectsV
FbHects that can enhance the application are -nown as the Scripting FbHects!
"hat is the Frder of precedence for LF8(.AL Fperators!
/FT, A/C, F2, WF2, )P4, (MP
"hat is an )rr FbHectV
/ame itKs properties and methods!
What are )(#A) and -)(5A) variables?
Local ariables lifetime ends when the Procedure ends! 8lobal ariables
lifetime begins at the start of the script and ends at the end of the script and
it can be used by any procedure within the script! Ceclaring a ariable by
using the -eyword P2(4AT) ma-es the ariable global within the script, but if
declared using P7IL(., then all scripts can refer the ariable!
"hich is the default Scripting Language on the client sideV
AaaScript
"hat is HTML(Hyperte#t Mar-up Language)V
(tKs a method by which web pages can be built and generally used for
formatting and lin-ing te#t!
What is a Web Server?
(tKs a .omputer that proides "eb serices on the (nternet or on a local
(ntranet! (t is designed to locate, address and send out simple HTML pages to
all other users who access these pages!
What is IIS?
((S is a "eb Serer that proides "eb serices, not only for web pages but
also for ftp sites and ideo and audio serices! (t integrates with the
database facilities of SPL Serer!
"hat is Session FbHectV
(t stores information about a 7serKs session! 8ies a noti:cation when a user
session begins or ends!
"hat is Serer0Side includesV
(t proides e#tra information by which it ma-es the site easier to manage! (t
can include te#t :les using the Xinclude statement, retriee the siRe and last
modi:cation date of a :le, de:nes how ariables and error messages are
displayed and inserts the alues of HTTP ariables in the page sent bac- to
the browser!
"hat is a 5ileSystemFbHect obHectV
(t proides access to the physical :le system of the web serer! (t gets and
manipulates information about all dries in a serer, folders and sub0folders
on a drie and :les inside a folder!
"hat is a Scripting LanguageV
(t permits to create more interactie "eb Pages! 4alidation, formatting of
web pages can be done! 4IScript, AaaScript are some e#amples!
"hat is a Cictionary obHectV
(t lets you store and retriee information in a Ye#ible data structure! )ach
alue or information stored in a Cictionary is associated with a -ey through
which the information can be retrieed!
"hat is 8lobal!asa :leV
(t is te#t :le that contains details about an ASP application, such as when it
should begin and end!
"hat is an !ASP :leV
(t is a Te#t 5ile that contains the combination of the following;
Te#t
HTML tags
Script .ommands
"hat is 2esponse FbHectV
(t controls the information sent to the user! The arious methods are;
2esponse!"rite 0 Sends information directly to a browser
2esponse!2edirect 0 Cirects a user to a 72L other than the re3uested 72L
2esponse!.ontentType 0 .ontrols the type of content sent
2esponse!.oo-ies 0 Sets coo-ie alues
2esponse!IuBer 0 To IuBer information
/aming constraints for a ariable V
(t can be up to $MM characters Must start with an alphabet Must not contain
an embedded period or full0stop
"hat is a Te#tStream obHectV
(t allows you to access(readQwrite) the contents of te#t :les stored on the
web serer!
What is 9equest (b7ect?
8ets information from the user! (t has :e collections by which alues can be
accessed! They are; Puerystring, 5orm, .oo-ies, Serer 4ariables >
.lient.erti:cate
"hat are the special sub0types in 4IScriptV
)MPT9; has no alue
/7LL; 4alue does not e#ist (conHunction with database)
FIA).T;
"hat is .oo-ies collectionV
.oo-ies are te#t :les that store information about the user by which the web
serer identi:es and mar-s each diBerent isitor to a web site and
determines where a user has been before! A coo-ie can store information
only when the user sends it! (ndiidual coo-ies are limited to 'ZI of data!
The ma#imum number of coo-ies allowed is ,%%!
.oo-ies are stored on clientKs machine!
"hat is the diBerence between .oo-ies collection and 5ormQPuerystring
collectionV
.oo-ie collection does not hae the .ount property! .oo-ies can hae
multiple alues for the same coo-ie name but each alue can be referred
using a -ey whereas in a 5ormQPuerystring coo-ie each alue has to be
referred using an inde# alue!
"hat is Serer FbHectV
.ontrols the ASP e#ecution enironment! (t can set the amount of time script
can run before an error occurs! .onerts a irtual path to a physical path on
the serer! Ta-es a user supplied string and encode it into proper format for a
72L string!
"hat is .ollectionV
.ollection is a set of nameQalue pairs where the information supplied by the
client is stored!
How will you delete a .oo-ieV
Iy setting its )#pires property to any date prior to today
2esponse!.oo-ies(1coo-ie name1)! )#pires ? Cate D!
"hat is the function of IuBer in 2esponse FbHectV
IuBer controls the HTML output stream manually!
How are scripts executed?
ASP proides scripting engines that e#ecute the corresponding scripting
languages on the serer side! Scripts should be encoded within the
Celimiters!
"hat is ASP (Actie Serer Pages)V
ASP is a serer side0scripting enironment for building dynamic and
interactie web pages! Since the scripts run on the serer side, the web
serer does all the processing!
"hat are A22A9SV
Arrays are ariables that store items of similar information!C(M A22A9D(')
(declares an array with the name arrayD with M elements)
"hat is Application0scopeV
Application0scope means that ariables (and obHects) can be accessed from
any ASP pages that is part of the application!
"hat is )#tranetV
An area of a web site aailable only to a set of registered isitors!
"hat is a sessionV
A user accessing an application is -nown as a session!
"hat is .lient.erti:cate collectionV
A .lient.erti:cate is an encrypted number that is stored in a :le on the
userKs computer! This stores details of any security certi:cates included with
the re3uest!
"hat do you need to run ASPV
A browser and a "eb serer
What is the order of execution for an ASP application?
D) 8lobal!asa
$) Serer0side (ncludes
,) Ascript scripts tagged within
"hat are the types of HTMLV
Static HTML Irowser uses HTTP to re3uest HTML :le from the "eb Serer
Cynamic HTML Irowser uses HTTP to re3uest an e#ecutable application
rather than a Static HTML :le
"hat are the properties of Session FbHectV
Session(C returns the session identi:cation number for each user!
Timeout sets the timeout period assigned to the Session obHect for any
application, in minutes!
.odePage determines the code page that will be used to display content!
L.(C a locale identi:er, which determines time Rone and language, rules for
the system
"hat are the eent handlers of Session FbHectV
Session 6FnStart This eent will be :red when a new user begins a session
with the web site!
Session6Fn)nd This eent is called wheneer a session terminates!
/ame the ASP FbHectsV
2e3uest FbHect
2esponse FbHect
Serer FbHect
Session FbHect
Application FbHect
)rror FbHect
"hat are the adantages of using ASPV
MinimiRes networ- traSc by limiting the need for the browser and serer to
tal- to each other
Ma-es for 3uic-er loading time since HTML pages are only downloaded
Allows to run programs in languages that are not supported by the browser
.an proide the client with data that does not reside on the clientKs machine
Proides improed security measures since the script cannot be iewed by
the browser
"hat are the methods in Application FbHectV
Loc- preents clients from modifying the ariables stored in the Application
obHect!
7nloc- remoes the loc- from ariables stored in the Application obHect!
"hat are the methods in Application FbHectV
(nternet (nformation Serer (((S) on "indows /T
Personal "eb Serer (P"S) on "indows +M
Peer "eb Serices on "indows /T
"hat are the browsers that can access ASP pagesV
(nternet )#plorer (supports 4IScript, AaaScript)
/etscape .ommunicatorQ /aigator (supports only AaaScript, 4IScript can
be also added too)
"hat are the methods by which output stream is controlledV
5lush sends preious buBered output to the client immediately, but
continues processing the script!
.lear erases any already0buBered HTML!
)nd causes the serer to stop processing the script!
"hat are the methods by which output stream is controlledV
"hat are the properties used to control the e#piration of the pageV
)#pires speci:es the number of minutes before a page cached on a browser
e#pires!
)#piresAbsolute sets the date and time at which a page cached on a browser
e#pires!
"hat are the collections of Session FbHectV
.ontents collection contains all the ariables established for a session
without using the tag!
Static collection contains all the obHects created
"hat is the diBerence between ASP and HTMLV Fr "hy ASP is better than
HTMLV
0 ASP e#ecutes code on the serer side whereas the browser interprets HTML!
0 ASP can use any scripting languages
0 8ets feedbac- from the user and return information to the user
0 .reate pages that will be customiRed to display only things that will be of
interest to a particular user
0 .an edit contents of a web page by updating a te#t :le or a database rather
than the HTML code itself
"hat are the eent handlers of Application FbHectV
Application6FnStart0 This eent will be :red when the :rst isitor hits the
page!
Application6Fn)nd0 This eent runs when the serer is stopped!
/ame some of the ASP componentsV
Ad 2otator component0 a way to manage adertisements on the web site!
.ontent Lin-er component 0 a techni3ue to direct users through a set of
pages on a web site by creating a list of 72Ls and description of the ne#t and
preious pages!
Irowser .apabilities component 0 allows to customiRe the page to the ability
of the browser iewing it!
Catabase Access component 0 allows to access data from the database
"hat are the tas-s performed by <@ tagsV
tags proides space for the user to input alues
the form has a button to submit information bac- to the serer
(t transfers control to another ASP page
(t carries the information in the :elds to another ASP page
"hat are the tags necessary to be present within the tag V
00000tag; Proides input spaces (te#t bo#es, combo bo#es, radio button, etc!)
on a form called :elds! (t has three attributes T9P), /AM) and 4AL7)! T9P)
proides the characteristics of the :eld and the /AM) speci:es a name to
the :eld by which it can be referred!
"hat are the collections of Application FbHectV
T .ontents collection 0 contains all ariables added ia scripts in global!asa!
T Static collection 0 contains the names of all obHects
How do you create a recordset obHect in 4IScriptV
AnswerD
QQ5irst of all declare a ariable to hold the 2ecordset obHect, e#0
Cim obH2s
QQ/ow, .reate this arible as a 2ecordset obHect, e#0
Set obH2s?Serer!.reateFbHect(ACFCI!2).F2CS)T)
Answer$
L rs!Moe/e#t
wend
end if
=K@
T! .reate 2ecordset obHect
T! Place form :eld alue in a ariable named [paramL
T! Ce:ne 3uery by concatenating strings and ariable alue
T! Fpen 2ecordSet FbHect! /ote that the :rst parameter is the .ommand
Te#t! The second parameter is the .onnection String! The .ommand FbHect
and .onnection FbHect are created implicitly!
T! Ma-e sure the 2ecordSet isnKt empty
T! Iegin e#ecuting a loop which goes through all records in the 2ecordSet!
T! "rite each recordKs [:rstnameL and [lastnameL :elds to the page on a
separate line!
T! Moe to /e#t 2ecord!
)#plain the diBerence between PFST and 8)T Method!
8)T re3uests are string data that is isible to the end user ia the 72L and a
limit of $-b, PFST re3uests hae no limit on total data and the user canKt see
the data in a 3uery string!
"hy do we use Fption )#plicitV
AnswerD
To aoid multiple ariables of the same name!
Answer$;
.orrect answer is 0 This statement force the declaration of ariables in 4I
before using them!
How do you write an SPL insert statementV
insert into tablename (:eldA, :eldI, :eld.)4alues(KdataAK, JdataIK, Jdata.K)E
How can you hae diBerent number of cells for each row of a table in HTMLV
using colspan and rowspan
"hat ariable can you use to share info across the whole application for one
userV
7se the sessions obHect
"hat is string concatenation function in 4IScriptV
the ampersand symbol and ampersand space underscore across multiple
lines
How do you get the alue of a combo bo# in AaascriptV
AnswerD!
document!forms\Kform/ameK]!elements\Kcombo/ameK]!options\i]!alue
Answer$!
document!form6name!element6name!alue
"hat is a class in .SSV
AnswerD
A class allows you to de:ne diBerent style characteristics to the same HTML
element!
Answer$
class is a child to the id, id should be used only once, a css class can be used
multiple times;
di id?LbannerL
p class?LalertL
"hen inserting strings into a SPL table in ASP what is the ris- and how can
you preent itV
SPL (nHection, to preent you probably need to use Stored Procedures instead
of inlineQincode SPL
"hich is the default Cata types in 4IScriptV
4ariant!
Hi,
( hae gien some -ey 3uestions and some lead answers for them!!! hope they will be useful
for you!!!
! /)T 3uestions
D! )#plain the !/)T architecture!
$! How many languages !/)T is supporting nowV
"hen !/et was introduced it came with some DG languages! 4I!/)T, .X, .FIFL and P)2L
etc
,! How !/)T is able to support multiple languagesV
A language should comply the .ommon Language 2untime standard to become a !/)T
language!
(n !/)T, code is compiled to Microsoft (ntermediate Language (MS(L for short)
This is called as Managed .ode!
This Managed code is run in !/)T enironment! So after compilation to this (L the language is
not a barrier!
A code can call Q use a function written in another language!
'! How ASP !/)T diBerent from ASPV
Scripting is separated from the HTML
.ode is compiled as a CLL
So adantages of compiled
These CLLs can be ached in the serer!
M! 2esource 5iles; How to use the resource :les, how to -now which language to useV
G! "hat is smart naigationV
The cursor position is maintained when the page gets refreshed due to the serer side
alidation and the page gets refreshed!
^! "hat is iew stateV
The web is stateless! Iut in ASP!/)T, the state of a page is maintained in the in the page
itself automatically!
HowV The alues are encrypted and saed in hidden controls! this is done automatically by
the ASP!/)T
This can be switched oB Q on for a single control
&! )#plain the life cycle of an ASP !/)T page!
+! How do you alidate the controls in an ASP !/)T pageV
7sing special alidation controls that are meant for this! "e hae 2ange 4alidator, )mail
4alidator,
D%! .an the alidation be done in the serer sideV Fr this can be done only in the .lient
sideV
.lient side is done by default! Serer side alidation is also possible! "e can switch oB the
client side and serer side can be done!
DD! How to manage pagination in a pageV
7sing pagination option in Cata8rid control!
"e hae to set the number of records for a page, then it ta-es care of pagination by itself!
D$! "hat is ACF !/)T and what is diBerence between ACF and ACF!/)TV
ACF!/)T is stateless mechanism! ( can treat the ACF!/et as a separate in0memory database
where in ( can use relationships between the tables and select insert and updates to the
database! ( can update the actual database as a batch!
),plain t*e .N)- arc*itecture.
.o+ many lan'ua'es .N)- is supportin' no+/ 0 1*en .N)- +as introduced it came +it*
several lan'ua'es. 2$.N)-& C3& CO$O4 and 5erl& etc. -*e site #otNet4an'ua'es.Net says 66
lan'ua'es are supported.
.o+ is .N)- able to support multiple lan'ua'es/ 0 a lan'ua'e s*ould comply +it* t*e Common
4an'ua'e Runtime standard to become a .N)- lan'ua'e. 7n .N)-& code is compiled to Microso(t
7ntermediate 4an'ua'e !MS74 (or s*ort%. -*is is called as Mana'ed Code. -*is Mana'ed code is
run in .N)- environment. So a(ter compilation to t*is 74 t*e lan'ua'e is not a barrier. " code can
call or use a (unction +ritten in anot*er lan'ua'e.
.o+ "S5 .N)- di((erent (rom "S5/ 0 Scriptin' is separated (rom t*e .-M4& Code is compiled
as a #44& t*ese #44s can be e,ecuted on t*e server.
Resource Files8 .o+ to use t*e resource (iles& *o+ to 9no+ +*ic* lan'ua'e to use/
1*at is smart navi'ation/ 0 -*e cursor position is maintained +*en t*e pa'e 'ets re(res*ed due
to t*e server side validation and t*e pa'e 'ets re(res*ed.
1*at is vie+ state/ 0 -*e +eb is stateless. $ut in "S5.N)-& t*e state o( a pa'e is maintained in
t*e in t*e pa'e itsel( automatically. .o+/ -*e values are encrypted and saved in *idden controls.
t*is is done automatically by t*e "S5.N)-. -*is can be s+itc*ed o(( : on (or a sin'le control
),plain t*e li(e cycle o( an "S5 .N)- pa'e.
.o+ do you validate t*e controls in an "S5 .N)- pa'e/ 0 Usin' special validation controls t*at
are meant (or t*is. 1e *ave Ran'e 2alidator& )mail 2alidator.
Can t*e validation be done in t*e server side/ Or t*is can be done only in t*e Client side/ 0
Client side is done by de(ault. Server side validation is also possible. 1e can s+itc* o(( t*e client
side and server side can be done.
.o+ to mana'e pa'ination in a pa'e/ 0 Usin' pa'ination option in #ata;rid control. 1e *ave to
set t*e number o( records (or a pa'e& t*en it ta9es care o( pa'ination by itsel(.
1*at is "#O .N)- and +*at is di((erence bet+een "#O and "#O.N)-/ 0 "#O.N)- is
stateless mec*anism. 7 can treat t*e "#O.Net as a separate in0memory database +*ere in 7 can
use relations*ips bet+een t*e tables and select insert and updates to t*e database. 7 can update
t*e actual database as a batc*.
This is a list of 3uestions ( hae gathered and created oer a period of time from my e#perience, many
of which ( felt where incomplete or simply wrong! ( hae :nally ta-en the time to go through each
3uestion and correct them to the best of my ability! Howeer, please feel free to post feedbac- to
challenge, improe, or suggest new 3uestions! ( want to than- those of you that hae contributed
3uality 3uestions and corrections thus far!
There are some 3uestions in this list that ( do not consider to be good 3uestions for an interiew!
Howeer, they do e#ist on other lists aailable on the (nternet so ( felt compelled to -eep them here for
easy access!
Cescribe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process!
inetinfo!e#e is theMicrosoft ((S serer running, handling ASP!/)T re3uests among other things!"hen an
ASP!/)T re3uest is receied (usually a :le with !asp# e#tension), the (SAP( :lter aspnet6isapi!dll ta-es
care of it by passing the re3uest tothe actual wor-er process aspnet6wp!e#e!

"hatKs the diBerence between 2esponse!"rite() and2esponse!Futput!"rite()V
2esponse!Futput!"rite() allows you to write formatted output!

"hat methods are :red during the page loadV
(nit() 0 when the page is instantiated
Load() 0 when the page is loaded into serer memory
Pre2ender() 0 the brief moment before the page is displayed to the user as HTML
7nload() 0 when page :nishes loading!

When during the page processing cycle is ViewState available?
After the (nit() and before the Page6Load(), or FnLoad() for a control!

"hat namespace does the "eb page belong in the !/)T 5ramewor- class hierarchyV
System!"eb!7(!Page

"here do you store the information about the userKs localeV
System!"eb!7(!Page!.ulture

"hatKs the diBerence between .odebehind?1My.ode!asp#!cs1 andSrc?1My.ode!asp#!cs1V
.odeIehind is releant to 4isual Studio!/)T only!

"hatKs a bubbled eentV
"hen you hae a comple# control, li-e Cata8rid, writing an eent processing routine for each obHect
(cell, button, row, etc!) is 3uite tedious! The controls can bubble up their eenthandlers, allowing the
main Cata8rid eent handler to ta-e care of its constituents!

Suppose you want a certain ASP!/)T function e#ecuted on MouseFer for a certain button! "here do
you add an eent handlerV
Add an FnMouseFer attribute to the button! )#ample;
btnSubmit!Attributes!Add(1onmouseoer1,1some.lient.odeHere()E1)E

"hat data types do the 2ange4alidator control supportV
(nteger, String, and Cate!

)#plain the diBerences between Serer0side and .lient0side codeV
Serer0side code e#ecutes on the serer! .lient0side code e#ecutes in the client*s browser!

"hat type of code (serer or client) is found in a .ode0Iehind classV
The answer is serer0side code since code0behind is e#ecuted on the serer! Howeer, during the
code0behind*s e#ecution on the serer, it can render client0side code such as AaaScript to
be processed in the clients browser! Iut Hust to be clear, code0behind e#ecutes on the serer, thus
ma-ing it serer0side code!

Should user input data alidation occur serer0side or client0sideV "hyV
All user input data alidation should occur on the serer at a minimum! Additionally, client0side
alidation can be performed where deemed appropriate and feasable to proide a richer, more
responsie e#perience for the user!

"hat is the diBerence between Serer!Transfer and 2esponse!2edirectV "hy would ( choose one oer
the otherV
Serer!Transfer transfers page processing from one page directly to the ne#t page without ma-ing a
round0trip bac- to the client*s browser! This proides a faster response with a little less oerhead on
the serer! Serer!Transfer does not update the clients url history list or current url! 2esponse!2edirect
is used to redirect the user*s browser to another page or site! This performas a trip bac- to the client
where the client*s browser is redirected to the new page! The user*s browser history list is updated to
reYect the new address!

.an you e#plain the diBerence between an ACF!/)T Cataset and an ACF 2ecordsetV
4alid answers are;
_ A CataSet can represent an entire relational database in memory, complete with tables, relations,
and iews!
_ A CataSet is designed to wor- without any continuing connection to the original data source!
_ Cata in a CataSet is bul-0loaded, rather than being loaded on demand!
_ There*s no concept of cursor types in a CataSet!
_ CataSets hae no current record pointer 9ou can use 5or )ach loops to moe through the data!
_ 9ou can store many edits in a CataSet, and write them to the original data source in a single
operation!
_ Though the CataSet is uniersal, other obHects in ACF!/)T come in diBerent ersions for diBerent
data sources!

What is the Global.asax used for?
The 8lobal!asa# (including the 8lobal!asa#!cs :le) is used to implement application and session leel
eents!

"hat are the Application6Start and Session6Start subroutines used forV
This is where you can set the speci:c ariables for the Application and Session obHects!

.an you e#plain what inheritance is and an e#ample of when you might use itV
"hen you want to inherit (use the functionality of) another class! )#ample; "ith a base class named
)mployee, a Manager class could be deried from the )mployee base class!

"hats an assemblyV
Assemblies are the building bloc-s of the !/)T framewor-! Overview of assemblies from MSDN

Cescribe the diBerence between inline and code behind!
(nline code written along side the html in a page! .ode0behind is code written in a separate :le and
referenced by the !asp# page!

)#plain what a diBgram is, and a good use for oneV
The CiB8ram is one of the two WML formats that you can use to render CataSet obHect contents to
WML! A good use is reading database data to an WML :le to be sent to a "eb Serice!

"hats MS(L, and why should my deelopers need an appreciation of it if at allV
MS(L is the Microsoft (ntermediate Language! All !/)T compatible languages will get conerted to
MS(L! MS(L also allows the !/)T 5ramewor- to A(T compile the assembly on the installed computer!

"hich method do you ino-e on the CataAdapter control to load your generated dataset with dataV
The 5ill() method!

.an you edit data in the 2epeater controlV
/o, it Hust reads the information from its data source.

"hich template must you proide, in order to display data in a 2epeater controlV
(temTemplate!

How can you proide an alternating color scheme in a 2epeater controlV
7se the Alternating(temTemplate.

"hat property must you set, and what method must you call in your code, in order to bind the data
from a data source to the 2epeater controlV
9ou must set the CataSource property and call the CataIind method!

"hat base class do all "eb 5orms inherit fromV
The Page class!

/ame two properties common in eery alidation controlV
.ontrolTo4alidate property and Te#t property!

"hich property on a .ombo Io# do you set with a column name, prior to setting the CataSource, to
display data in the combo bo#V
CataTe#t5ield property!

"hich control would you use if you needed to ma-e sure the alues in two diBerent controls matchedV
.ompare4alidator control!

How many classes can a single !/)T CLL containV
(t can contain many classes!

"eb Serice Puestions
"hat is the transport protocol you use to call a "eb sericeV
SFAP (Simple FbHect Access Protocol) is the preferred protocol!

True or 5alse; A "eb serice can only be written in !/)TV
5alse

"hat does "SCL stand forV
"eb Serices Cescription Language!

"here on the (nternet would you loo- for "eb sericesV
http://www.uddi.org

True or 5alse; To test a "eb serice you must create a "indows application or "eb application to
consume this sericeV
5alse, the web serice comes with a test page and it proides HTTP08)T method to test!

State Management Puestions
What is ViewState?
4iewState allows the state of obHects (serialiRable) to be stored in a hidden :eld on the page!
4iewState is transported to the client and bac- to the serer, and is not stored on the serer or any
other e#ternal source! 4iewState is used the retain the state of serer0side obHects between
postabac-s!

What is the lifespan for items stored in ViewState?
(tem stored in 4iewState e#ist for the life of the current page! This includes postbac-s (to the same
page)!

What does the "EnableViewState" property do? Why would want it on or off?
(t allows the page to sae the users input on a form across postbac-s! (t saes the serer0side alues
for a gien control into 4iewState, which is stored as a hidden alue on the page before sending the
page to the clients browser! "hen the page is posted bac- to the serer the serer control is
recreated with the state stored in iewstate!

What are the different types of Session state management options available with !S".#E$?
ASP!/)T proides (n0Process and Fut0of0Process state management! (n0Process stores the session in
memory on the web serer! This re3uires the a 1stic-y0serer1 (or no load0balancing) so that the user
is always reconnected to the same web serer! Fut0of0Process Session state management stores data
in an e#ternal data source! The e#ternal data source may be either a SPL Serer or a State Serer
serice! Fut0of0Process state management re3uires that all obHects stored in session are serialiRable!
"hat do ( need to create and run an ASP!/)T applicationV
"indows $%%%, "indows Serer $%%, or "indows WP!
ASP!/)T, which can be either the redistributable (included in the !/)T SCZ) or 4isual
Studio !/)T!
"here can ( download the !/)T SCZV
!/)T SCZ can be obtained here!
(9ou hae to install the Microsoft .NET Framewor !ersio" #.# $edistributable %acage before installing the !/)T SCZ!)
Are there any free (C)s for the !/)T SCZV
Microsoft proides 4isual Studio $%%M )#press )dition Ieta for free! Ff particular
interest to the ASP!/)T deelopers would be the 4isual "eb Ceeloper $%%M )#press
)dition Ieta $ aailable as a free dow"load!
The ASP!/)T "eb Matri# ProHect (supported by Microsoft) is a free (C) for deeloping
ASP!/)T applications and is aailable here!
There is also a free open0source 7/(W ersion of the Microsoft !/)T deelopment
platform called Mono aailable for download here!
Another increasingly popular Fpen Source Ceelopment )nironment for !/)T is the
Xdeelop (short for SharpCeelop) aailable for download here!
"hen was ASP!/)T releasedV
ASP!/)T is a part of the !/)T framewor- which was released as a software platform
in $%%$!
(s a new ersion coming upV
ASP!/)T $!%, 4isual Studio $%%M ("hidbey), 4isual "eb Ceeloper $%%M )#press
)dition are the ne#t releases of Microsoft*s "eb platform and tools! They hae
already been released as Ieta ersions! They are scheduled to be released in the
wee- of /oember ^, $%%M!
)#plain /amespace!
/amespaces are logical groupings of names used within a program! There may be
multiple namespaces in a single application code, grouped based on the identi:ersK
use! The name of any gien identi:er must appear only once in its namespace!
List the types of Authentication supported by ASP!/)T!
"indows (default)
5orms
Passport
/one (Security disabled)
"hat is .L2V
.ommon Language 2untime (.L2) is a run0time enironment that manages the
e#ecution of !/)T code and proides serices li-e memory management,
debugging, security, etc! The .L2 is also -nown as 4irtual )#ecution System (4)S)!
"hat is .L(V
The .L( is a set of speci:cations for a runtime enironment, including a common
type system, base class library, and a machine0independent intermediate code
-nown as the .ommon (ntermediate Language (.(L)! (Source; "i-ipedia!)
List the arious stages of Page0Load lifecycle!
Init()
Load()
PreRender()
Unload()
)#plain Assembly and Manifest!
An assembly is a collection of one or more :les and one of them (CLL or )W))
contains a special metadata called Assembly Manifest! The manifest is stored as
binary data and contains details li-e ersioning re3uirements for the assembly, the
author, security permissions, and list of :les forming the assembly! An assembly is
created wheneer a CLL is built! The manifest can be iewed programmatically by
ma-ing use of classes from the System.Reflection namespace! The tool
(ntermediate Language Cisassembler ((LCASM) can be used for this purpose! (t can
be launched from the command prompt or ia Start@ 2un!
"hat is Shadow .opyV
(n order to replace a .FM component on a lie web serer, it was necessary to stop
the entire website, copy the new :les and then restart the website! This is not
feasible for the web serers that need to be always running! !/)T components are
diBerent! They can be oerwritten at any time using a mechanism called Shadow
.opy! (t preents the Portable )#ecutable (P)) :les li-e CLLs and )W)s from being
loc-ed! "heneer new ersions of the P)s are released, they are automatically
detected by the .L2 and the changed components will be automatically loaded!
They will be used to process all new re3uests not currently e#ecuting, while the
older ersion still runs the currently e#ecuting re3uests! Iy bleeding out the older
ersion, the update is completed!
"hat is CLL HellV
CLL hell is the problem that occurs when an installation of a newer application
might brea- or hinder other applications as newer CLLs are copied into the system
and the older applications do not support or are not compatible with them! !/)T
oercomes this problem by supporting multiple ersions of an assembly at any
gien time! This is also called side0by0side component ersioning!
)#plain "eb Serices!
"eb serices are programmable business logic components that proide access to
functionality through the (nternet! Standard protocols li-e HTTP can be used to
access them! "eb serices are based on the Simple FbHect Access Protocol (SFAP),
which is an application of WML! "eb serices are gien the .asmx e#tension!
)#plain "indows 5orms!
"indows 5orms is employed for deeloping "indows 87( applications! (t is a class
library that gies deelopers access to "indows .ommon .ontrols with rich
functionality! (t is a common 87( library for all the languages supported by the !/)T
5ramewor-!
"hat is Postbac-V
"hen an action occurs (li-e button clic-), the page containing all the controls within
the <FORM... > tag performs an HTTP PFST, while haing itself as the target 72L!
This is called Postbac-!
)#plain the diBerences between serer0side and client0side codeV
Serer side scripting means that all the script will be e#ecuted by the serer and
interpreted as needed! .lient side scripting means that the script will be e#ecuted
immediately in the browser such as form :eld alidation, cloc-, email alidation,
etc! .lient side scripting is usually done in 4IScript or AaaScript! Since the code is
included in the HTML page, anyone can see the code by iewing the page source! (t
also poses as a possible security haRard for the client computer!
)numerate the types of Cirecties!
@ Page directie
@ Imort directie
@ Imlements directie
@ Register directie
@ !ssem"ly directie
@ O#t#t$ac%e directie
@ Reference directie
"hat is .ode0IehindV
.ode0Iehind is a concept where the contents of a page are in one :le and the
serer0side code is in another! This allows diBerent people to wor- on the same
page at the same time and also allows either part of the page to be easily
redesigned, with no changes re3uired in the other! An In%erits attribute is added to
the @ Page directie to specify the location of the .ode0Iehind :le to the ASP!/)T
page!
Cescribe the diBerence between inline and code behind!
(nline code is written along side the HTML in a page! There is no separate distinction
between design code and logic code! .ode0behind is code written in a separate :le
and referenced by the .aspx page!
List the ASP!/)T alidation controlsV
Re&#iredField'alidator
Range'alidator
$omare'alidator
Reg#lar()ression'alidator
$#stom'alidator
'alidationS#mmary
"hat is Cata IindingV
Cata binding is a way used to connect alues from a collection of data (e!g! *ataSet)
to the controls on a web form! The alues from the dataset are automatically
displayed in the controls without haing to write separate code to display them!
Cescribe Paging in ASP!/)T!
The *ata+rid control in ASP!/)T enables easy paging of the data! The !llo,Paging
property of the *ata+rid can be set to -r#e to perform paging! ASP!/)T
automatically performs paging and proides the hyperlin-s to the other pages in
diBerent styles, based on the property that has been set for PagerStyle.Mode!
Should user input data alidation occur serer0side or client0sideV "hyV
All user input data alidation should occur on the serer and minimally on the client0
side, though it is a good way to reduce serer load and networ- traSc because we
can ensure that only data of the appropriate type is submitted from the form! (t is
totally insecure! The user can iew the code used for alidation and create a
wor-around for it! Secondly, the 72L of the page that handles the data is freely
isible in the original form page! This will allow unscrupulous users to send data
from their own forms to your application! .lient0side alidation can sometimes be
performed where deemed appropriate and feasible to proide a richer, more
responsie e#perience for the user!
"hat is the diBerence between Serer!Transfer and 2esponse!2edirectV
Response.Redirect; This tells the browser that the re3uested page can be found at a
new location! The browser then initiates another re3uest to the new page loading its
contents in the browser! This results in two re3uests by the browser!
Server.Transfer; (t transfers e#ecution from the :rst page to the second page on
the serer! As far as the browser client is concerned, it made one re3uest and the
initial page is the one responding with content! The bene:t of this approach is one
less round trip to the serer from the client browser! Also, any posted form ariables
and 3uery string parameters are aailable to the second page as well!

S-ar putea să vă placă și