Interview
Interview
sid=5
ASP - ASP
1 . What is ASP?
ASP stands for Active Server Pages. It is a server side technology which is used to display
dynamic content on web pages. For example you could write code that would give your visitors
different information, different images or even a totally different page depending on what
browser version they are using.
6 . What is a variable?
Variable is a memory location through which the actual values are stored/retrieved. Its
value can be changed.
It allows you to extract data sent to the server using a GET request.
8 . What are the attributes of the tags? What are their functions?
The two attributes are ACTION and METHOD
The ACTION gives the name of the ASP file that should be opened next by which this file can
access the information given in the form The METHOD determines which of the two ways (POST
or GET) the browser can send the information to the server
17 . Explain the POST & GET Method or Explain the difference between them?
POST METHOD:
The POST method generates a FORM collection, which is sent as a HTTP request body. All the
values typed in the form will be stored in the FORM collection.
GET METHOD:
The GET method sends information by appending it to the URL (with a question mark) and stored
as A Querystring collection. The Querystring collection is passed to the server as name/value
pair.
The length of the URL should be less than 255 characters.
1 of 5 9/21/2010 7:22 PM
PrepareForJob.com http://prepareforjob.com/ASP.aspx?sid=5
34 . What is IIS?
IIS is a Web Server that provides Web services, not only for web pages but also for ftp sites
and video and audio services. It integrates with the database facilities of SQL Server.
2 of 5 9/21/2010 7:22 PM
PrepareForJob.com http://prepareforjob.com/ASP.aspx?sid=5
OBJECT:
40 . What is Collection?
Collection is a set of name/value pairs where the information supplied by the client is
stored.
46 . What is Application-scope?
Application-scope means that variables (and objects) can be accessed from any ASP pages
that is part of the application.
47 . What is Extranet?
An area of a web site available only to a set of registered visitors.
48 . < SCRIPT LANGUAGE="VBScript" RUNAT=Server > a = 1 < /SCRIPT > < SCRIPT
LANGUAGE="VBScript" > a = 2 < /SCRIPT > < % Response.Write a % < In the sample
code shown above, what will be written to the screen?
A. 1
B. 2
C. 1, 2
D. 1&2
E. Nothing. (Answer)
49 . < % iPos = Instr("Hello World","r") % < Referring to the above, what is the value
of iPos?
A. 0
B. 1
C. 2
D. 8
E. 9 (Answer)
3 of 5 9/21/2010 7:22 PM
PrepareForJob.com http://prepareforjob.com/ASP.aspx?sid=5
Request Object
Response Object
Server Object
Session Object
Application Object
Minimizes network traffic by limiting the need for the browser and server to talk to each
other
Makes for quicker loading time since HTML pages are only downloaded
Allows to run programs in languages that are not supported by the browser
Can provide the client with data that does not reside on the client’s machine
Provides improved security measures since the script cannot be viewed by the browser
57 . How does the server identify and execute the server-side scripts within HTML
code?
Including the RUNAT=SERVER attribute
59 . What are the properties used to control the expiration of the page?
Expires specifies the number of minutes before a page cached on a browser expires.
ExpiresAbsolute sets the date and time at which a page cached on a browser expires.
61 . What is the difference between ASP and HTML? Or Why ASP is better than HTML?
ASP executes code on the server side whereas the browser interprets HTML.
ASP can use any scripting languages
Gets feedback from the user and return information to the user
Create pages that will be customized to display only things that will be of interest to a
particular user
Can edit contents of a web page by updating a text file or a database rather than the
HTML code itself
4 of 5 9/21/2010 7:22 PM
PrepareForJob.com http://prepareforjob.com/ASP.aspx?sid=5
Dim objRs
//Now, Create this varible as a Recordset object, ex-
Set objRs=Server.CreateObject(ADODB.RECORDSET)
Answer2
” rs.MoveNext
wend
end if
%’>
*. Create Recordset object
*. Place form field value in a variable named “param”
*. Define query by concatenating strings and variable value
*. Open RecordSet Object. Note that the first parameter is the Command Text. The second
parameter is the Connection String. The Command Object and Connection Object are created
implicitly.
*. Make sure the RecordSet isn’t empty
*. Begin executing a loop which goes through all records in the RecordSet.
*. Write each record’s “firstname” and “lastname” fields to the page on a separate line.
*. Move to Next Record
Answer2:
Correct answer is - This statement force the declaration of variables in VB before using them.
71 . How can you have different number of cells for each row of a table in HTML?
using colspan and rowspan
72 . What variable can you use to share info across the whole application for one user?
Use the sessions object
Answer2.
document.form_name.element_name.value
Answer2
class is a child to the id, id should be used only once, a css class can be used multiple times:
div id=”banner”
p class=”alert”
76 . When inserting strings into a SQL table in ASP what is the risk and how can you
prevent it?
SQL Injection, to prevent you probably need to use Stored Procedures instead of
inline/incode SQL
5 of 5 9/21/2010 7:22 PM