多项选择题
You are developing an ASP.NET Web page. You add the following markup to the page.
You add the following code segment to the code-behind.
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?()
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);
相关考题
-
单项选择题
YouaredevelopinganASP.NETWebapplication.Youcreateamasterpage.Themasterpagerequiresaregionwhereyoucanaddpage-specificcontentbyusingtheASP.NETpagedesigner.Youneedtoaddacontroltothemasterpagetodefinetheregion.Whichcontrolshouldyouadd?()
A.PlaceHolder
B.ContentPlaceHolder
C.Content
D.Substituition -
多项选择题
oucreateapageinanASP.NETWebapplication.ThepageretrievesanddisplaysdatafromaMicrosoftSQLServerdatabase.Youneedtocreateadatasourcethatcanconnecttothedatabase.Whataretwopossiblewaystoachievethisgoal?()
A.Use an ObjectDataSource control and set its TypeName property to System.Data.SqlClient.SqlConnection.
B.Use a SqlDataSource control and configure its ConnectionString in the web.config file.
C.Use an XmlDataSource control together with an Xml control that represents the database.
D.Use a LinqDataSource control with entity classes that represent the elements in the database. -
单项选择题
YouareimplementinganASP.NETpagethatwillretrievelargesetsofdatafromadatasource.YouaddaListViewcontrolandaDataPagercontroltothepage.Youneedtoensurethatthedatacanbeviewedonepageatatime.Whatshouldyoudo?()
A.Set the DataPager control’s PageSize property to the number of rows to view at one time.
B.Set the DataPager control’s PagedControlID property to the ID of the ListView control.
C.In the code-behind file, set the DataPager control’s Parent property to the ListView control.
D.In the code-behind file, set the ListView control’s Parent property to the DataPager control.
