Which two actions should you perform?

You are developing an ASP.NET Web page. You add the following markup to the page.
<asp:FileUpload id="FileUpload1" runat="server" />
<asp:Button id="btnUpload" Text="Upload selected file" OnClick="btnUpload_Click" runat="server" />
<asp:Label id="lblFeedback" runat="server" />
You add the following code segment to the code-behind. (Line numbers are included for reference only.)

You need to save the uploaded file and display a message to the user that indicates that the upload either succeeded or failed. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Replace line 3 with the following code segment.
if (FileUpload1.HasFile)
B. Replace line 3 with the following code segment.
if (FileUpload1.FileContent.Length > 0)
C. Insert the following code segment at line 6.
FileUpload1.SaveAs(saveName);
D. Insert the following code segment at line 6.
FileUpload1.FileContent.CopyTo(new FileStream(saveName, FileMode.Open);

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.