You are creating an ASP.NET application for an online payment service. The
service allows users to pay their bills electronically by using a credit card.
The application includes a payment page named Payment.aspx. This page contains a form
for entering payes, payment amount, and credit card information. When a user needs to
submit a new billing address to a payee, the page form allows the user to provide the new
address information. If the user indicates a change of address,
ProcessAddressChange.aspx page processes the request for a change of address but does
not provide any display information for the user. When the requested processing is
complete. Payment.aspx displays status results to the user.
You need to add a line of code to Payment.aspx to perform the functionality in
ProcessAddressChange.aspx
Which line of code should you use?
You are a developer working on a content management application. When users
submit a piece of content they are required to classify it by selecting its type from a
dropdown list. In the next version of the application it has been determined that the users
will be allowed to select multiple classifications from the list for each piece of content.
How would change the DropDownList to support this functionality?
A -
Set the AutoPostBack of the DropDownList to true. Write code so that when the user makes a selection and the control posts back to the server another copy of the drop down list is generated and placed on the page below the first.
B -
Replace the DropDownList with a Listbox control and set the SelectionMode to Multiple.
C -
Change the DropDownList to an ArrayList control and set the SelectionMode to Multiple.
D -
Change the selection of the DropDownList to Multiple and set the rows property to 5 to show five options at time.s
3-
You are intersested in examining the data that is posed to the Web server. What
trace section can you use to see this information?
A -
Form Collection
B -
Control Tree
C -
Headers Collection
D -
Server Variables.
4-
You are a developer working on a News information site. The marketing
department has asked that you collect data about which pages are visited based on the
time that a user first hits the site. There is no security on the site, so a user can enter the
site at any page.
What is the best way to establish the date and time of the users visit to the site?
A -
Place the following code in the Global.asax file: private void Session_Start(Object sender, EventArgs e) { Session["EnterSite Time"] =Date Time.Now; }
B -
Place the following code in the page load event of every page: if(Session["EnterSite Time"] = = null) { Session["EnterSite Time"] =Date Time.Now; }
C -
Place the following code in the Global.asax file: private void Application_Start(Object sender, EventArgs e) { Session["EnterSite Time"] =Date Time.Now; }
D -
Place the following code in the page load event of every page: if(Application["EnterSite Time"] = = null) { Application["EnterSite Time"] =Date Time.Now; }
5-
You are a developer working on an ASP.Net application that allows customers
to shop for different types of automobiles. Based on whether the user picks a truck or a
car you need to load a different calculator function to excute client-side on the browser.
How would you send the correct JavaScript function to the browser?
You are a developer working on a student enrollment application. When
students log into the site they use their student ID, which is an integer and an alpha numeric password. Once they are authenticated their student numbers are stored in the
Session object. You are working on a page that accesses the student ID from the Session object but every
time you attempt to compile the page you get the following error: Cannot implicitly convert type object to int Visual Studio flags the following line of code for you
int iStudentID = Session["StudentID"];
How would you fix this line of code?
A -
int iStudentID = Session["StudentID"]. ToInteger();
B -
int iStudentID = (int) Session["StudentID"]);
C -
int iStudentID = Session.GetInt32["StudentID"]);
D -
int iStudentID = CInt(Session["StudentID"]);
7-
You are in the process of upgrading an existing ASP application to ASP.NET
by converting pages one by one to the new architecture. The application currently uses an
SP.NET page to request the users first name, which is stored in a session variable with
this line of code: Session["FirstName"] = txtFirstName.Text; You run the application and enter a first name on the ASP.NET page. When you browse
to an existing ASP page that uses the FirstName session variable, the first name is blank.
What could be the problem?
A -
You do not have cookies enabled on your computer.
B -
The ASP and ASP.NET engines do not share session state or application state
C -
The ASP page needs to explicity retrieve the Value property of the Session object
D -
You must explicitly use the Page.Session property to store shared session state
8-
You are developing an online bookstore application in Visual C# .NET. Your
application needs to store the most recent book viewed by the user and show the recently
viewed books details in the lower part of the Web pages whenever the user accesses the
Web site. You do not want to use server-side resources to store the book ISBN. Which of
the following state-management techniques will help you accomplish this?
A -
Cookies
B -
View state
C -
Hidden fields
D -
Sessions
9-
You are developing an application to take orders over the Internet. When a user
posts back the order form, you first check to see whether she is a registered customer of
your company. If not, you must transfer control to the Register.html page. Which method
should you use to transfer it?
A -
Server.Execute("Register.html");
B -
Server.Transfer("Register.html");
C -
Response.Redirect("Register.html");
D -
Server.CreateObject("Register.html");
10-
You are developing an ASP.NET application using Visual C# .NET. In your
ASPX page, you want to invoke and display a Visual C# .NET method named DisplayProductName( ) when the page is rendered to the client. Which of the following
code blocks should you choose to call the DisplayProductName( ) method?