ASP Programming

  Home  Microsoft .Net Technologies  ASP Programming


“Learn ASP Programming by Interview Questions and Answers.”



194 ASP Programming Questions And Answers

61⟩ 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.

An ASP file can contain text, HTML tags

. And scripts. Scripts in an ASP file are executed on the server.

 168 views

63⟩ What is Session Object?

It stores information about a User’s session. It gives a notification when a user session begins or ends.

 203 views

64⟩ What are LOCAL and GLOBAL variables?

Local variables lifetime ends when the Procedure ends. Global variables 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. Declaring a variable by using the keyword PRIVATE makes the variable global within the script, but if declared using PUBLIC, then all scripts can refer the variable.

 189 views

65⟩ What are the tasks performed by <FORM> tags?

<FORM> 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

 189 views

68⟩ What is Response Object?

It controls the information sent to the user. The various methods are:

Response.Write? Sends information directly to a browser

Response.Redirect? Directs a user to a URL other than the requested URL

Response.ContentType? Controls the type of content sent

Response.Cookies? Sets cookie values

Response.Buffer? To Buffer information

The ASP Response object is used to send output to the user from the server.

 233 views

70⟩ What is the command to display characters to the HTML page?

Typically, a servlet class is instantiated the first time it is invoked. The same instance will be used over several client requests, so all members that are declared in that servlet are shared across clients. That is What is meant by multi threaded model, multiple clients that access the same instance.

There are situations where you want to protect your servlet member variables from being modified by different clients. In this case, you can have your servlet implement the marker interface SingleThreadModel. Every time a client makes a request to a servlet that implements this interface, the engine will create a new instance of the servlet. For performance reasons, the engine can also maintain an instance pool, handing out instances as they are needed. Or it could also serialize client requests, executing one after another.

 201 views

71⟩ How to insert the records in a database table by using ASP?

<%

'Open a Connection with database

Dim DSN

DSN="Provider=SQLOLEDB.1; Persist security info=false; user id=sa; password=main; initial catalog=database name Data Source=localhost"

set objCon=Server.CreateObject("ADODB.Connection")

objCon.Open DSN

%>

<%

'Get the Query

Dim SQL

SQL="insert into tablename values('a','b','c')"

%>

<%

'Insert Into Database

objCon.Execute(SQL)

%>

 175 views

72⟩ What is http header?

HTTP headers expose a great deal of information about your client as well as the server you are working, the application you are designing, as well as the environment you are in (SSL, etc.).The functionality for this is held in "Request.ServerVariables", so you only need to access that. For example, Request.ServerVariables("ALL_HTTP") or Request.ServerVariables("HTTP_USER_AGENT"). You need to know the specific name of the header that you want. It is extremely simple to display all the HTTP headers in ASP. Here's a code snippit that will do it for you: < % for each header in Request.ServerVariables response.write header & " = " & Request.ServerVariables (header) & " < br>< br> " next % >Just delete the spaces near the angle brackets and run it on IIS. You'll get a list of all the HTTP headers along with the actual value for the header. Make sure to try this with different browsers and on different computers with different operating systems if you can. You'll immediately see the differences.

 162 views

74⟩ Explain life cycle of ASP page.

Active server pages are executed with the help of compiler and then it sent to the MSIL (MICROSOFT INTERMEDIATE LANGUAGE) and then it is sent to cache memory and finally it will be executed in the portable device. Cache will be used between the MSIL to increase the speed of the process. This is the process of the ASP life cycle.

 174 views

75⟩ What are the tools used for editing in IIS?

The MetaEdit 2.2 utility is used to help to troubleshoot issues and to modify IIS metabase values. MtaEdt22.exe file is a downloadable, self-extracting file that contains the IIS MetaEdit 2.2 utility.

 178 views

76⟩ What are the special sub-types in VBScript?

Subtype Explanation

Empty Variant is not initialized. Value is either zero for numeric variables or a zero-length string ("") for string variables.

Null Variant intentionally contains no valid data.

Boolean Contains either True or False.

Byte Contains integer in the range zero to 255

Integer Contains integer in the range -32,768 to 32,767

Long Contains integer in the range -2,147,483,648 to 2,147,483,647

Single Contains a single-precision, floating-point number in the range -3.402823E38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.402823E38 for positive values.

Double Contains a double-precision, floating-point number in the range -1.79769313486232E308 to -4.94065645841247E-324 for negative values; 4.94065645841247E-324 to 1.79769313486232E308 for positive values

Date (Time) Contains a number that represents a date between January 1, 100 to December 31, 9999

String Contains a variable-length string that can be up to about 2 billion characters in length

Object Contains an OLE Automation object.

Error contains an error number.

 179 views

77⟩ What is a File System Object object?

The File System Object is used to access the file system on the server. This object can manipulate files, folders, and directory paths. It is also possible to retrieve file system information with this object.

 184 views

78⟩ What does Server.Map Path do?

The Map Path method maps the specified relative or virtual path to the corresponding physical directory on the server.

Name at least three methods of response object other than Redirect.

Add Header, Append To Log, Binary Write, Clear, End, Flush, Write

 189 views

79⟩ What is Querystring collection?

This collection stores any values that are provided in the URL. This can be generated by three methods:

By clicking on an anchor tag

by sending a form to the server by the GET method

through user-typed HTTP address

it allows you to extract data sent to the server using a GET request.

 175 views