最新的Microsoft TS: Web Applications Development with Microsoft .NET Framework 4 - 070-515免費考試真題
You are implementing an ASP.NET Web page.
You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose
two.)
You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose
two.)
正確答案: A,B
You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code.
<uc:TestUserControl ID="testControl" runat="server"/>
On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New
York".
You also must add code to TestPage.aspx to read this value.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
<uc:TestUserControl ID="testControl" runat="server"/>
On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New
York".
You also must add code to TestPage.aspx to read this value.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
正確答案: A,B
You are implementing an ASP.NET application. You add the following code segment.
public List<Person> GetNonSecretUsers()
{ string[] secretUsers = {"@secretUser", "@admin", "@root"}; List<Person> allpeople = GetAllPeople(); ...
}
You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list.
The resulting list must not contain duplicates. Which code segment should you use?
public List<Person> GetNonSecretUsers()
{ string[] secretUsers = {"@secretUser", "@admin", "@root"}; List<Person> allpeople = GetAllPeople(); ...
}
You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list.
The resulting list must not contain duplicates. Which code segment should you use?
正確答案: C
You are creating an ASP.NET Web site.
The site has a master page named Custom.master.
The code-behind file for Custom.master contains the following code segment.
public partial class CustomMaster : MasterPage
{ public string Region { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
}
}
You create a new ASP.NET page and specify Custom.master as its master page.
You add a Label control named lblRegion to the new page.
You need to display the value of the master page's Region property in lblRegion.
What should you do?
The site has a master page named Custom.master.
The code-behind file for Custom.master contains the following code segment.
public partial class CustomMaster : MasterPage
{ public string Region { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
}
}
You create a new ASP.NET page and specify Custom.master as its master page.
You add a Label control named lblRegion to the new page.
You need to display the value of the master page's Region property in lblRegion.
What should you do?
正確答案: B
You are developing an ASP.NET Web page.
The page uses the MicrosoftAjax.js script file and the MicrosoftAjaxWebForms.js script file.
You need to ensure that both scripts are combined into a single script.
Which markup should you use?
The page uses the MicrosoftAjax.js script file and the MicrosoftAjaxWebForms.js script file.
You need to ensure that both scripts are combined into a single script.
Which markup should you use?
正確答案: B
Which class is used to specify a set of features to support on the XmlReader object created by the Create method?
正確答案: C
You create a new ASP.NET MVC 2 Web application.
The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference
only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
05 routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller
= "Home", action = "Index", id = ""});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult About() public ActionResult Index() public ActionResult Details(int id)
You need to ensure that the About action is invoked when the root URL of the site is accessed. What should you do?
The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference
only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
05 routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller
= "Home", action = "Index", id = ""});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult About() public ActionResult Index() public ActionResult Details(int id)
You need to ensure that the About action is invoked when the root URL of the site is accessed. What should you do?
正確答案: C
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.)
01 protected void btnUpload_Click(object sender, EventArgs e)
02 {
03 if (...)
04 {
05 string saveName = Path.Combine(@"c:\uploadedfiles\",
FileUpload1.FileName);
06
07 lblFeedback.Text = "File successfully uploaded.";
08 }
09 else
10 {
11 lblFeedback.Text = "File upload failed.";
12 }
13 }
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.)
<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.)
01 protected void btnUpload_Click(object sender, EventArgs e)
02 {
03 if (...)
04 {
05 string saveName = Path.Combine(@"c:\uploadedfiles\",
FileUpload1.FileName);
06
07 lblFeedback.Text = "File successfully uploaded.";
08 }
09 else
10 {
11 lblFeedback.Text = "File upload failed.";
12 }
13 }
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.)
正確答案: C,D
You are perfoming security testing on an existing asp.net web page.
You notice that you are able to issue unauthorised postback requests to the page.
You need to prevent unauthorised post back requests. which page directive you use?
You notice that you are able to issue unauthorised postback requests to the page.
You need to prevent unauthorised post back requests. which page directive you use?
正確答案: D
Which class provides paging functionality for data-bound controls that implement the IPageableItemContainer interface?
正確答案: D
Which of the following is the correct collection of build events?
正確答案: B
You are developing an ASP.NET web page that includes a Panel Control that has ID ContentSection. You need to add a text box control to the Panel control.
Which code segment should you use?
Which code segment should you use?
正確答案: A
You are developing an ASP.NET templated server control.
You need to ensure that a new ID namespace is created within the page control hierarchy when the control
is added to a page.
Which interface should you implement on the control?
You need to ensure that a new ID namespace is created within the page control hierarchy when the control
is added to a page.
Which interface should you implement on the control?
正確答案: A
You are developing an ASP.NET MVC 2 Web Application.
You need to implement an asynchronous controller named AccountingController, and you must ensure that
the export action required proper authorization.
Which code segment should you use?
You need to implement an asynchronous controller named AccountingController, and you must ensure that
the export action required proper authorization.
Which code segment should you use?
正確答案: B