Microsoft
70-515 · Question #199
70-515 Question #199: Real Exam Question with Answer & Explanation
Sign in or unlock 70-515 to reveal the answer and full explanation for question #199. The question stem and answer options stay visible for context.
Question
You are developing an ASP.NET Web page. The page contains the following markup. <asp:GridView ID="gvModels" runat="server" onrowdatabound="gvModels_RowDataBound" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="Name" HeaderText="Model" /> asp:TemplateField <ItemTemplate> <asp:Image ID="img" runat="server" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> The pages code-behind file includes the following code segment. (Line numbers are included for reference only.) 01 Private Sub gvModels_RowDataBound(ByVal sender As Object, _ 02 ByVal e As GridViewRowEventArgs) _ 03 Handles gvModels.RowDataBound 04 If (e.Row.RowType = DataControlRowType.DataRow) Then 05 Dim cm As CarModel = 06 DirectCast(e.Row.DataItem, CarModel) 08 img.ImageUrl = 09 String.Format("images/{0}.jpg", cm.ID) 11 End If 12 End Sub You need to get a reference to the Image named img. Which code segment should you add at line 07?
Options
- ADim img As Image =
- BDim img As Image =
- CDim img As Image =
- DDim img As Image =
Unlock 70-515 to see the answer
You've previewed enough free 70-515 questions. Unlock 70-515 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.