Questions

1) Which of the following languages can be used to write server side scripting in ASP.NET?
       a) C-sharp
       b) VB
       c) C++
       d)  (your answer) a and b - correct answer



2) When an .aspx page is requested from the web server, the out put will be rendered to browser in following format.
       a)  (your answer) HTML - correct answer
       b) XML
       c) WML
       d) JSP



3) The Asp.net server control, which provides an alternative way of displaying text on web page, is
       a)  (your answer) < asp:label > - correct answer
       b) < asp:listitem >
       c) < asp:button >



4) The first event to be triggered in an aspx page is.
       a) Page_Load()
       b)  (your answer) Page_Init() - correct answer
       c) Page_click()



5) Postback occurs in which of the following forms.
       a) Winforms
       b) HTMLForms
       c)  (your answer) Webforms - correct answer



6) What namespace does the Web page belong in the .NET Framework class hierarchy?
       a) System.web.UI.Page - correct answer
       b) System.Windows.Page
       c)  (your answer) System.Web.page



7) Which method do you invoke on the Data Adapter control to load your generated dataset?
       a)  (your answer) Fill( ) - correct answer
       b) ExecuteQuery( )
       c) Read( )



8) How do you register a user control?
       a) Add Tag prefix, Tag name
       b) Add Source, Tag prefix
       c)  (your answer) Add Src, Tagprefix, Tagname - correct answer



9) Which of the following is true?
       a)  (your answer) User controls are displayed correctly in the Visual Studio .NET Designer
       b) Custom controls are displayed correctly in VS.Net Designer - correct answer
       c) User and Custom controls are displayed correctly in the Visual Studio .NET Designer.



10) To add a custom control to a Web form we have to register with.
       a) TagPrefix
       b) Name space of the dll that is referenced
       c)  (your answer) Assemblyname
       d) All of the above - correct answer



11) Custom Controls are derived from which of the classes
       a) System.Web.UI.Webcontrol
       b) System.Web.UI.Customcontrol
       c)  (your answer) System.Web.UI.Customcontrols.Webcontrol - correct answer



12) How ASP.Net Different from classic ASP?
       a) Scripting is separated from the HTML, Code is interpreted seperately
       b)  (your answer) Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server - correct answer
       c) Code is separated from the HTML and interpreted Code is interpreted separately



13) What's the difference between Response.Write() andResponse.Output.Write()?
       a) Response.Output.Write() allows you to flush output
       b) Response.Output.Write() allows you to buffer output
       c)  (your answer) Response.Output.Write() allows you to write formatted output - correct answer
       d) Response.Output.Write() allows you to stream output



14) Why is Global.asax is used?
       a)  (your answer) Implement application and session level events - correct answer
       b) Declare Global variables
       c) No use



15) There can be more than 1 machine.config file in a system
       a)  (your answer) True - correct answer
       b) False



16) What is the extension of a web user control file?
       a)  (your answer) .Asmx
       b) .Ascx - correct answer
       c) .Aspx



17) Which of the following is true?
       a) IsPostBack is a method of System.UI.Web.Page class
       b) IsPostBack is a method of System.Web.UI.Page class
       c)  (your answer) IsPostBack is a readonly property of System.Web.UI.Page class - correct answer



18) The number of forms that can be added to a aspx page is.
       a) 1 - correct answer
       b) 2
       c) 3
       d)  (your answer) More than 3



19) How do you manage states in asp.net application
       a) Session Objects
       b) Application Objects
       c) Viewstate
       d)  (your answer) All of the above - correct answer



20) Which property of the session object is used to set the local identifier?
       a)  (your answer) SessionId
       b) LCID - correct answer
       c) Item
       d) Key



21) Select the caching type supported by ASP.Net
       a) Output Caching
       b) DataCaching
       c)  (your answer) a and b - correct answer
       d) none of the above



22) Where is the default Session data is stored in ASP.Net?
       a)  (your answer) InProcess - correct answer
       b) StateServer
       c) Session Object
       d) al of the above



23) Select the type Processing model that asp.net simulate
       a) Event-driven - correct answer
       b)  (your answer) Static
       c) Linear
       d) Topdown



24) Does the EnableViewState allows the page to save the users input on a form?
       a)  (your answer) Yes - correct answer
       b) No



25) Which DLL translate XML to SQL in IIS?
       a)  (your answer) SQLISAPI.dll - correct answer
       b) SQLXML.dll
       c) LISXML.dll
       d) SQLIIS.dll



26) What is the maximum number of cookies that can be allowed to a web site?
       a) 1
       b) 10
       c)  (your answer) 20 - correct answer
       d) More than 30



27) Select the control which does not have any visible interface.
       a) Datalist
       b) DropdownList
       c)  (your answer) Repeater - correct answer
       d) Datagrid



28) How do you explicitly kill a user session?
       a) Session.Close( )
       b) Session.Discard( )
       c)  (your answer) Session.Abandon - correct answer
       d) Session.End
       e) Session.Exit



29) Which of the following is not a member of ADODBCommand object?
       a) ExecuteReader
       b) ExecuteScalar
       c) ExecuteStream
       d) Open - correct answer
       e)  (your answer) CommandText



30) Which one of the following namespaces contains the definition for IdbConnection?
       a) System.Data.Interfaces
       b) System.Data.Common
       c) System.Data - correct answer
       d)  (your answer) System.Data.Connection



1) In ASP, a request object retrieves info from a user by ________.
       a) a collection of values sent as cookies in a HTTP header
       b) a collection of data sent with a submitted form
       c)  (your answer) from client variables described from within an object
       d) from the OS module
       e) A&B - correct answer


2) Which of the following are ASP standard objects?
       a) server
       b) response
       c) session
       d)  (your answer) All of the above - correct answer


3) Abandon is an ASP ________ object method.
       a) server
       b)  (your answer) session - correct answer
       c) request
       d) response


4) In ASP, the Response Object is used to send output to the user from the server.
       a)  (your answer) True - correct answer
       b) False


5) MapPath is an ASP ________ object method.
       a) session
       b)  (your answer) request
       c) server - correct answer
       d) response


6) ASP is an acronym for what?
       a) Active Server Protocol
       b)  (your answer) ActiveX Server Pages
       c) Active Setup Pages
       d) Active Server Pages - correct answer
       e) Active Setup Protocol


7) ASP makes a website more interactive and dynamic.
       a) True - correct answer
       b)  (your answer) False


8) How do you comment a line in ASP using VBScript?
       a)  (your answer) 
       b) < Comment a line in ASP >
       c) 'Comment a line in ASP - correct answer
       d) <% Comment a line in ASP %>


9) Which is better in managing your code when writing with ASP or any other scripting code?
       a) Break it up into smaller easier-to-manage files that can serve as subroutines and function calls. - correct answer
       b)  (your answer) Keep it nice and simple in one file and use subroutines and function calls.


10) My ASP page won't work is a common complaint for those new to ASP. Which of these can be the cause?
       a) Syntax error such as missing parentheses, comma or quotation mark.
       b) Comments in your code are not tagged properly as comments.
       c)  (your answer) Make sure function names have both opening and closing parentheses.
       d) Check to see that the web page is properly saved with the extension as .asp
       e) All of the above - correct answer


11) You want to add ASP capability to your company's website. What is the first thing you would check?
       a) That all pages are saved in .asp extensions.
       b) Check that the web server has Microsoft FrontPage extensions installed.
       c)  (your answer) Make sure the web server is capable of hosting ASP pages. - correct answer
       d) Check the coding and be sure the ASP code is surrounded with <% and %>
       e) All of the above


12) You have determined that your company's website is housed on a web server that cannot handle ASP. What would you do?
       a) Contact the ISP and have them switch the website to have ASP capability.
       b)  (your answer) Have your ISP install the Microsoft FrontPage extensions
       c) Develop a transition plan first that includes a step-by-step plan on every detail prior to contacting the ISP. - correct answer
       d) All the above


13) Some say that JavaScript is easier to use than ASP and will run regardless of whatever operating system the web server is using (Unix, Linux, Windows 2000, etc). Then others say that ASP has advantages over JavaScript such as what?
       a) ASP does not depend upon which browser the viewer is using.
       b) ASP code does not show up in the source code; thus, the code is protected
       c)  (your answer) ASP does not download with the page to the viewer.
       d) ASP can easily interact with a database.
       e) All of the above - correct answer


14) A feature of ASP is its ability to interact with a database. Which of these databases is the most popular to use with ASP?
       a) dBase
       b)  (your answer) Delimited text files
       c) Access (97 or 2000) - correct answer
       d) Excel spreadsheets
       e) SQL


15) JavaScript is which?
       a)  (your answer) Client-side executable code (executes at the browser level) - correct answer
       b) Server side executable code (runs at the server only)


16) ASP is which?
       a)  (your answer) Client-side executable code (executes at the browser level)
       b) Server side executable code (runs at the server only) - correct answer


17) Client-side scripting code and server-side scripting code can coexist and can be used on the same page.
       a)  (your answer) True - correct answer
       b) False


18) Variable are used to hold both numerical and text values. Which of these IS NOT a valid variable name?
       a) X
       b)  (your answer) X1
       c) 1X - correct answer
       d) x1X


19) Which of these is OKAY to use for a variable name?
       a) employee salary
       b)  (your answer) 2nd_employee
       c) employee_hire_date - correct answer
       d) date-of-birth
       e) date_of.birth


20) You have a long piece of code tracking employee salaries. In your opinion, which of these variables is the best (shortest yet most descriptive) to use throughout the code to track the salaries of the managers? Keep in mind that you may try to analyze your
       a) manager_salaries
       b)  (your answer) SalariesOfManagers
       c) Salaries_Of_Managers
       d) mgmtSalary - correct answer
       e) Salary1


21) ASP code is....
       a) a client-side executable code.
       b)  (your answer) a server-side executable code. - correct answer
       c) a world-wide-web executable code.
       d) all of the above.


22) Which programming language is most commonly used to script ASP code?
       a) ASP
       b)  (your answer) JavaScript
       c) VBScript - correct answer
       d) C++
       e) Perl


23) ASP pages can contain embedded HTML code.
       a)  (your answer) True - correct answer
       b) False


24) What happens when a user types in a URL that requests an ASP page?
       a) Browser requests ASP code, server returns code, browser executes code into HTML form
       b)  (your answer) Browser requests ASP code, server executes ASP code and returns HTML document to browser - correct answer
       c) Browser requests code, server returns code, Windows executes code since ASP is Microsoft code.


25) If the default pages in HTML are index.htm, default.html, etc, what are the default pages in ASP?
       a) index.asp
       b) default.asp
       c)  (your answer) home.asp
       d) Both A and B - correct answer
       e) Both B and C


26) When writing ASP code, what are the correct delimiters to use?
       a)
       b)  (your answer) < code >
       c) <% code >
       d) <% code %> - correct answer


27) It is imperative when writing ASP code is to begin every file with which statement?
       a) <% Language=VBScript %>
       b)  (your answer) <% ASPLanguage = VBScript %>
       c) <%@ Language=VBScript %> - correct answer


28) In order for you to execute ASP code on your computer, you need to be running web server software such as Personal Web Server.
       a)  (your answer) True - correct answer
       b) False


29) ASP code can be written in any text editor such as Notepad.
       a)  (your answer) True - correct answer
       b) False


30) Thinking Question: ASP code can be written to show the current time. Is it possible to show a live, ticking clock using ASP?
       a)  (your answer) Yes, ASP will pull the time from the web server and feed it to the client browser.
       b) No, once the ASP script has finished executing, it cannot do any more after the page reaches the client browser. - correct answer



-ASP ADO-
1) Database connectivity with ADO has 3 main objects:
       a) ADODB.Connection
       b) ADODB.Recordset
       c) ADODB.Command
       d)  (your answer) All of the above - correct answer


2) What is the sequential procedure in working with databases?
       a)  (your answer)  Open the database, interact with the db, close the database
       b) Open a connection, interact with the db, close the connection - correct answer


3) ActiveX Data Objects (ADO) comes installed with ASP and allows your pages to easily connect to databases. Which two ADO objects are used to open a connection and interact with the database?
       a) Connection object, RecordingSet object
       b)  (your answer) Connection object, Recordset object - correct answer
       c) Connect object, RecordingSet object
       d) Connect object, Recordset object


4) What is a connection object?
       a) Specifies whether to use a DSN or DSN-less connection
       b)  (your answer) Specifies which type of database is being used
       c) Specifies the type of driver to use, database format and filename
       d) First opens the initial connection to a database before giving any database information - correct answer


5) What is a connection string?
       a) Specifies whether to use a DSN or DSN-less connection
       b)  (your answer) Specifies which type of database is being used
       c) Specifies the type of ODBC driver to use, database format and filename - correct answer
       d) Opens the initial connection to a database


6) There are two methods of connecting to an Access database. Which are they?
       a) DNS, DNS-less
       b)  (your answer) DSN, DSN-less - correct answer
       c) ODBC, ADO
       d) OLEDB, ADO


7) Which connection method requires a connection object?
       a)  (your answer) DSN
       b) DSN-less
       c) Both - correct answer


8) Which connection method requires a connection string?
       a) DSN
       b) DSN-less
       c)  (your answer) Both - correct answer


9) What information can a connection string contain about the database you are trying to connect to?
       a) Type of database
       b) Type of driver to use
       c) Location of database
       d) username
       e)  (your answer) All Of The Above - correct answer


10) What must your ASP code have if you are using the DSN method of connecting?
       a) Connection object
       b) Connection string
       c)  (your answer) Both - correct answer


11) What must your ASP code have if you are using the DSN-less method of connecting?
       a) Connection object
       b)  (your answer) Connection string
       c) Both - correct answer


12) Which connection method is this code using?...Dim dbConn Set dbConn = Server.CreateObject("ADOBD.Connection") dbConn.Connectionstring = "DSN=Quiz; uid=login; pwd=password" dbConn.Open
       a) DSN
       b) DSN-less
       c)  (your answer) Neither - the code is wrong - correct answer


13) Which connection method is this code using?.. Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.Connectionstring = "DSN=Quiz; uid=login; pwd=password" dbConn.Open
       a) DSN - correct answer
       b)  (your answer) DSN-less
       c) Neither - the code is wrong


14) Which connection method is this code using?..Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\wwwroot\username\database.mdb" dbConn.open
       a) DSN
       b)  (your answer) DSN-less
       c) Both A and B
       d) Neither - the code is wrong - correct answer


15) Which connection method is this code using?..Dim dbConn Set dbConn = Server.CreateObject("ADODB.Connection") dbConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\wwwroot\username\database.mdd" dbConn.Open
       a) DSN
       b)  (your answer) DSN-less
       c) Neither - the code is wrong - correct answer


16) While it is important to properly open the connection to the database, it is equally important to close the connection. Leaving a connection open is the same as leaving your house with the door open...Dim dbConn Set dbConn = Server.CreateObject("ADODB.Con
       a)  (your answer) True
       b) False - correct answer


17) It is okay to have connections open to multiple Access databases
       a)  (your answer) True - correct answer
       b) False


18) What is the sequential procedure in working with databases?
       a) Connection string, connection object, close connection string, close connection object
       b)  (your answer) Connection object, connection string, close connection string, close connection object - correct answer
       c) Connection object, connection string, close connection object, close connection string