Active Server Pages interview questions

  1. How do you create a recordset object in VBScript?
  2. What is Querystring collection? - It allows you to extract data sent to the server using a GET request.
  3. 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.
  4. Why do we use Option Explicit? - To avoid multiple variables of the same name.
  5. How do you write an SQL insert statement? - insert into tablename (fieldA, fieldB, fieldC)Values(’dataA’, ‘dataB’, ‘dataC’);
  6. How can you have different number of cells for each row of a table in HTML? - using colspan and rowspan
  7. What is wrong with the following code: <%afname="header.asp"%><!–#include file ="<%=afname%>"–>
  8. What variable can you use to share info across the whole application for one user? - Use the sessions object
  9. What is string concatenation function in VBScript? - the ampersand symbol and ampersand space underscore across multiple lines
  10. How do you get the value of a combo box in Javascript? - document.forms['formName'].elements['comboName'].options[i].value
  11. What is a class in CSS? - A class allows you to define different style characteristics to the same HTML element.
  12. When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?
  13. Which is the default Data types in VBScript? - Variant.
This entry was posted in .NET, VB, Web dev, Windows. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

22 Comments on Active Server Pages interview questions

  1. Posted 6/18/2006 at 3:36 am | Permalink

    Q10 How do you get the value of a combo box in Javascript?

    Ans. document.form_name.element_name.value

  2. Posted 6/18/2006 at 3:44 am | Permalink

    Q4. Why do we use Option Explicit?

    Ans:- Correct answer is - This statement force the declaration of variables in VB before using them.

  3. Posted 6/18/2006 at 3:49 am | Permalink

    Q1. How do you create a recordset object in VBScript?

    Ans.
    //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)

  4. renu
    Posted 7/3/2006 at 2:36 pm | Permalink

    q7.

    dynamic includes is not possible in asp.

  5. Posted 7/5/2006 at 11:56 am | Permalink

    q7.

    I think dynamic includes is possible in asp through Sever.Execute

  6. Vishal
    Posted 7/11/2006 at 3:21 am | Permalink

    How to show one of the item from collection of dropdownlist into dropdownlist?

  7. shitesh
    Posted 7/21/2006 at 12:49 am | Permalink

    how to read text from doc file in asp page?

  8. Babu
    Posted 7/29/2006 at 8:39 am | Permalink

    How can i convert asp code in to asp.net code

  9. rajani
    Posted 8/1/2006 at 1:31 am | Permalink

    what is boxing?
    what is unboxing?
    what is deep copy & shallow copy?

  10. Tarun Chugh
    Posted 8/2/2006 at 2:13 am | Permalink

    How to send xml file data into sql for any file not a specific file

  11. Posted 8/3/2006 at 5:43 am | Permalink

    can i decrypt data in asp

  12. Sudeep
    Posted 8/14/2006 at 7:13 am | Permalink

    Comment#9
    what is boxing?
    what is unboxing?
    what is deep copy & shallow copy?

    Converting the value type into refrence type is call boxing.
    inboxing is just opposite.
    converting the refrence type into value type.

    When an object of value type is assigned with another, the data itself is copied from one object to another. Suppose there are two integer variables, count1 and count2. Further suppose that count1 contains the value 5 and that count2 is assigned the value of count1.

    count1 = 5;
    count2 = count1;

    Both count1 and count2 now contain their own copies of the data, in this case, the value 5. They are independent. If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy. The value itself is copied.

    For reference types copies work differently. Remember that a reference type consists of two parts: the data on the heap and the address of the data stored in the reference variable itself on the stack. When one reference variable is assigned to another, the address stored in the first is copied to the second. They both then refer to the same data content on the heap. This is referred to as a shallow copy.

  13. Sharmin Jose
    Posted 8/23/2006 at 6:02 am | Permalink

    int count1=5;
    int count2=count1;

    If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy.

    Hi Sudeep,
    How this will happen? When the program is running and once the value of count1 is changed, how come count2 will have a different value?

  14. karthikeyan
    Posted 9/5/2006 at 1:44 am | Permalink

    How do you create a recordset object in VBScript?

  15. Posted 9/11/2006 at 1:43 pm | Permalink

    11. What is a class in CSS? - A class allows you to define different style characteristics to the same HTML element.

    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”

  16. Posted 9/11/2006 at 1:45 pm | Permalink

    12. 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

  17. Vellaichamy
    Posted 10/11/2006 at 12:48 am | Permalink

    Q1.


    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.

  18. Sheryl
    Posted 10/23/2006 at 10:56 am | Permalink

    How to read text from doc file in asp page?

  19. Sheryl
    Posted 10/23/2006 at 11:05 am | Permalink

    dim fs,f,ts
    set fs=Server.CreateObject(”Scripting.FileSystemObject”)
    Set f=fs.GetFile(”c:\test.txt”)
    Set ts=f.OpenAsTextStream(ForReading)
    Response.Write(ts.ReadAll)
    ts.Close
    set ts=nothing
    set f=nothing
    set fs=nothing

  20. Akash
    Posted 11/22/2006 at 6:37 pm | Permalink

    When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?

    Ans:-The single qutation’s getting Insertion error,So need to convert it as double qutations.

  21. Hrach Gyulzadyan
    Posted 3/27/2007 at 2:12 pm | Permalink

    What is wrong with the following code: “–>

    You can’t use asp varriable in the include code, you just need to write

  22. Hrach Gyulzadyan
    Posted 3/27/2007 at 2:15 pm | Permalink

    How do you get the value of a combo box in Javascript?

    document.getElementById(”comboBoxId”).options[document.getElementById("comboBoxId").selectedIndex].value

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*