Dot NET Quiz – 1

31 10 2008

You create an ASP.NET application for TestKing Motors. The application allows 
users to purchase automobile insurance policies online. A page named 
InsuredAuto.aspx is used to gather information about the vehicle being insured. 
InsuredAuto.aspx contains a TextBox control named vehicleIDNumber. The user 
enters the vehicle identification number (VIN) of the vehicle into 
vehicleIDNumber and then clicks a
button to submit the page. The Button control is named submitButton. Upon 
submission of the
page, additional vehicle information is obtained for the VIN, and the page is 
redisplayed for showing the vehicle information. You define vehicleIDNumber by 
using the following HTML tag:
<asp:TextBox id=vehicleIDNumber runat=server
EnableViewState=True/>
Valid VINs are composed of numbers and uppercase letters. You need to include 
code that
converts any lowercase letters to uppercase letters so that the properly 
formatted VIN is
displayed after the page is submitted and redisplayed.
What are two possible ways to achieve this goal?

A. Add the following code to the vehicleIDNumber.TextChanged event handler for
InsuredAuto.aspx:
vehicleIDNumber.Text = vehicleIDNumber.Text.ToUpper();

B. Add the following code to the submitButton.Click event handler for 
InsuredAuto.aspx:
vehcicleIDNumber.Text = vehicleIDNumber.Text.ToUpper();

C. Add the following code to the Page.Init event handler for InsuredAuto.aspx:
vehicleIDNumber.Text = vehicleIDNumber.Text.ToUpper();

D. Add the following code to the Page.Render event handler for InsuredAuto.aspx:
vehicleIDNumber.Text = vehicleIDNumber.Text.ToUpper();

Options:

I.     C,D
II.    A,B
III.   D,B
IV.    A,C





Quiz of the Day – 1

12 07 2008

You have an .NET application that delivers news content (customized)over the Internet. Users are allowed to make selections from an ASP.NET page(similar to that of the iGoogle page). Your code creates a DataSet object named News_Items, which contains the news items that meet the criteria selected by the user. You create a style sheet named News_Style.xsl that renders the data in News_Items in HTML format. You write the following code segment:
 
XmlDataDocument doc = new XmlDataDocument(News_Items);
XslTransform tran = new XslTransform();
tran.Load(News_Style.xsl);
 
You want to display the transformed data as HTML text. Which line of code should
you add to the end of the code segment?
 
A. News_Items.WriteXml(Response.OutputStream);
 
B. tran.Transform(doc, null, Response.OutputStream);
 
C. News_Items.WriteXml(tran.ToString());
 
D. tran.Transform(doc, null, Request.InputStream);

Answer: next week…

Cheers!!!