ASP INTEVIEW QUESTIONS
How will you delete a Cookie?
By setting its Expires property to any date prior to today Response.Cookies(“cookie name”). Expires = Date 1.
What is the function of Buffer in Response Object?
Buffer controls the HTML output stream manually.
How are scripts executed?
ASP provides scripting engines that execute the corresponding scripting languages on the server side. Scripts should be encoded within the Delimiters.
What is ASP (Active Server Pages)?
ASP is a server side-scripting environment for building dynamic and interactive web pages. Since the scripts run on the server side, the web server does all the processing.
What are ARRAYS?
Arrays are variables that store items of similar information.DIM ARRAY1(4) (declares an array with the name array1 with 5 elements)
What is Application-scope?
Application-scope means that variables (and objects) can be accessed from any ASP pages that is part of the application.
What is Extranet?
An area of a web site available only to a set of registered visitors.
< language="VBScript" runat="Server">
a = 1
< /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)
< % 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)
What are the types of HTML?
Static HTML Browser uses HTTP to request HTML file from the Web Server
Dynamic HTML Browser uses HTTP to request an executable application rather than a Static HTML file
What are the properties of Session Object?
SessionID returns the session identification number for each user.
Timeout sets the timeout period assigned to the Session object for any application, in minutes.
CodePage determines the code page that will be used to display content.
LCID a locale identifier, which determines time zone and language, rules for the system
What are the event handlers of Session Object?
Session _OnStart This event will be fired when a new user begins a session with the web site.
Session_OnEnd This event is called whenever a session terminates.
Name the ASP Objects?
Request Object
Response Object
Server Object
Session Object
Application Object
What are the advantages of using ASP?
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
What are the methods in Application Object?
Lock prevents clients from modifying the variables stored in the Application object.
Unlock removes the lock from variables stored in the Application object.
What are the methods in Application Object?
What are the browsers that can access ASP pages?
Internet Explorer (supports VBScript, JavaScript)
Netscape Communicator/ Navigator (supports only JavaScript, VBScript can be also added too)
How does the server identify and execute the server-side scripts within HTML code?
Including the RUNAT=SERVER attribute
What are the methods by which output stream is controlled?
Flush sends previous buffered output to the client immediately, but continues processing the script.
Clear erases any already-buffered HTML.
End causes the server to stop processing the script.
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.
What are the collections of Session Object?
Contents collection contains all the variables established for a session without using the tag.
Static collection contains all the objects created
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
What are the event handlers of Application Object?
Application_OnStart- This event will be fired when the first visitor hits the page.
Application_OnEnd- This event runs when the server is stopped.
Name some of the ASP components?
Ad Rotator component- a way to manage advertisements on the web site.
Content Linker component – a technique to direct users through a set of pages on a web site by creating a list of URLs and description of the next and previous pages.
Browser Capabilities component – allows to customize the page to the ability of the browser viewing it.
Database Access component – allows to access data from the database
What are the tasks performed by <> tags?
tags provides space for the user to input values
the form has a button to submit information back to the server
It transfers control to another ASP page
It carries the information in the fields to another ASP page
What are the tags necessary to be present within the tag?
—–tag: Provides input spaces (text boxes, combo boxes, radio button, etc.) on a form called fields. It has three attributes TYPE, NAME and VALUE. TYPE provides the characteristics of the field and the NAME specifies a name to the field by which it can be referred.
What are the collections of Application Object?
* Contents collection – contains all variables added via scripts in global.asa.
* Static collection – contains the names of all objects
How do you create a recordset object in VBScript?
Answer1
//First of all declare a variable to hold the Recordset object, ex-
Dim objRs
//Now, Create this varible as a Recordset object, ex-
Set objRs=Server.CreateObject(ADODB.RECORDSET)
Explain the difference between POST and GET Method.
GET requests are string data that is visible to the end user via the URL and a limit of 2kb, POST requests have no limit on total data and the user can’t see the data in a query string.
Why do we use Option Explicit?
To avoid multiple variables of the same name.
Correct answer is – This statement force the declaration of variables in VB before using them.
How do you write an SQL insert statement?
insert into tablename (fieldA, fieldB, fieldC)Values(‘dataA’, ‘dataB’, ‘dataC’);
How can you have different number of cells for each row of a table in HTML?
using colspan and rowspan
What variable can you use to share info across the whole application for one user?
Use the sessions object
What is string concatenation function in VBScript?
the ampersand symbol and ampersand space underscore across multiple lines
How do you get the value of a combo box in Javascript?
Answer1.
document.forms['formName'].elements['comboName'].options[i].value
Answer2.
document.form_name.element_name.value
What is a class in CSS?
Answer1
A class allows you to define different style characteristics to the same HTML element.
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
Which is the default Data types in VBScript?
Variant.
How will you delete a Cookie?
By setting its Expires property to any date prior to today Response.Cookies(“cookie name”). Expires = Date 1.
What is the function of Buffer in Response Object?
Buffer controls the HTML output stream manually.
How are scripts executed?
ASP provides scripting engines that execute the corresponding scripting languages on the server side. Scripts should be encoded within the Delimiters.
What is ASP (Active Server Pages)?
ASP is a server side-scripting environment for building dynamic and interactive web pages. Since the scripts run on the server side, the web server does all the processing.
What are ARRAYS?
Arrays are variables that store items of similar information.DIM ARRAY1(4) (declares an array with the name array1 with 5 elements)
What is Application-scope?
Application-scope means that variables (and objects) can be accessed from any ASP pages that is part of the application.
What is Extranet?
An area of a web site available only to a set of registered visitors.
< language="VBScript" runat="Server">
a = 1
< /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)
< % 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)
What are the types of HTML?
Static HTML Browser uses HTTP to request HTML file from the Web Server
Dynamic HTML Browser uses HTTP to request an executable application rather than a Static HTML file
What are the properties of Session Object?
SessionID returns the session identification number for each user.
Timeout sets the timeout period assigned to the Session object for any application, in minutes.
CodePage determines the code page that will be used to display content.
LCID a locale identifier, which determines time zone and language, rules for the system
What are the event handlers of Session Object?
Session _OnStart This event will be fired when a new user begins a session with the web site.
Session_OnEnd This event is called whenever a session terminates.
Name the ASP Objects?
Request Object
Response Object
Server Object
Session Object
Application Object
What are the advantages of using ASP?
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
What are the methods in Application Object?
Lock prevents clients from modifying the variables stored in the Application object.
Unlock removes the lock from variables stored in the Application object.
What are the methods in Application Object?
- Internet Information Server (IIS) on Windows NT
- Personal Web Server (PWS) on Windows 95
- Peer Web Services on Windows NT
What are the browsers that can access ASP pages?
Internet Explorer (supports VBScript, JavaScript)
Netscape Communicator/ Navigator (supports only JavaScript, VBScript can be also added too)
How does the server identify and execute the server-side scripts within HTML code?
Including the RUNAT=SERVER attribute
What are the methods by which output stream is controlled?
Flush sends previous buffered output to the client immediately, but continues processing the script.
Clear erases any already-buffered HTML.
End causes the server to stop processing the script.
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.
What are the collections of Session Object?
Contents collection contains all the variables established for a session without using the tag.
Static collection contains all the objects created
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
What are the event handlers of Application Object?
Application_OnStart- This event will be fired when the first visitor hits the page.
Application_OnEnd- This event runs when the server is stopped.
Name some of the ASP components?
Ad Rotator component- a way to manage advertisements on the web site.
Content Linker component – a technique to direct users through a set of pages on a web site by creating a list of URLs and description of the next and previous pages.
Browser Capabilities component – allows to customize the page to the ability of the browser viewing it.
Database Access component – allows to access data from the database
What are the tasks performed by <> tags?
tags provides space for the user to input values
the form has a button to submit information back to the server
It transfers control to another ASP page
It carries the information in the fields to another ASP page
What are the tags necessary to be present within the tag?
—–tag: Provides input spaces (text boxes, combo boxes, radio button, etc.) on a form called fields. It has three attributes TYPE, NAME and VALUE. TYPE provides the characteristics of the field and the NAME specifies a name to the field by which it can be referred.
What are the collections of Application Object?
* Contents collection – contains all variables added via scripts in global.asa.
* Static collection – contains the names of all objects
How do you create a recordset object in VBScript?
Answer1
//First of all declare a variable to hold the Recordset object, ex-
Dim objRs
//Now, Create this varible as a Recordset object, ex-
Set objRs=Server.CreateObject(ADODB.RECORDSET)
Explain the difference between POST and GET Method.
GET requests are string data that is visible to the end user via the URL and a limit of 2kb, POST requests have no limit on total data and the user can’t see the data in a query string.
Why do we use Option Explicit?
To avoid multiple variables of the same name.
Correct answer is – This statement force the declaration of variables in VB before using them.
How do you write an SQL insert statement?
insert into tablename (fieldA, fieldB, fieldC)Values(‘dataA’, ‘dataB’, ‘dataC’);
How can you have different number of cells for each row of a table in HTML?
using colspan and rowspan
What variable can you use to share info across the whole application for one user?
Use the sessions object
What is string concatenation function in VBScript?
the ampersand symbol and ampersand space underscore across multiple lines
How do you get the value of a combo box in Javascript?
Answer1.
document.forms['formName'].elements['comboName'].options[i].value
Answer2.
document.form_name.element_name.value
What is a class in CSS?
Answer1
A class allows you to define different style characteristics to the same HTML element.
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
Which is the default Data types in VBScript?
Variant.
0 comments :
Post a Comment