MS.NET Framework 2.0-Web-based Client Development
Index >> Microsoft >> MCTS >> "70-528"Exam
VUE/Prometric Code:70-528
Questions and Answers:162 Q&As
Price:$ 89
Updated:2008-12-01
| MS.NET Framework 2.0-Web-based Client Development | |||
| Test | Q&A | Updated | Price |
| 70-528 | 162 Q&A | 2008-12-01 | $ 89 |
please download in PDF format Demo:
killtest 70-528 Exam Features
High quality and Value for the 70-528 Exam.
Killtest Practice Exams for MS.NET Framework 2.0-Web-based Client Development 70-528 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.
100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
We guarantee your success in the first attempt. If you do not pass the 70-528 (MS.NET Framework 2.0-Web-based Client Development) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.
killtest 70-528 Downloadable.
Printable Exams (in PDF format) Our Exam 70-528 Preparation Material provides you everything you will need to take your MCTS exam. The MCTS Certification details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, and logical. You may get MCTS exam questions from different web sites or books, but logic is the key. Our Product will help you not only pass in the first MCTS exam try, but also save your valuable time .
- Comprehensive questions with complete details about 70-528 exam.
- 70-528 exam questions accompanied by exhibits.
- Verified Answers Researched by Industry Experts and almost 100% correct.
- Drag and Drop questions as experienced in the Real MCTS exam.
- 70-528 exam questions updated on regular basis.
- Like actual MCTS Certification exams, 70-528 exam preparation is in multiple-choice questions (MCQs).
- Tested by many real MCTS exams before publishing.
- Try free MCTS exam demo before you decide to buy it in http://www.Killtest.com.
High quality and Value for the 70-528 Exam:100% Guarantee to Pass Your MCTS exam and get your MCTS Certification.
http://www.Killtest.com The safer.easier way to get MCTS Certification.
We offer Demo version of Q&A, Q&A are as follows (not to provide picture):
70-528:please download 70-528 in PDF format Demo 
1. Your Web site uses custom Themes. Your Web site must support additional Themes based on the user's company name.
The company name is set when a user logs on to the Web site. The company's Theme name is stored in a variable named ThemeName.
You need to use this variable to dynamically set the Web site's Theme.
What should you do?
A. Add the following code segment to the markup source of each page on the Web site.
<%@ Page Theme="ThemeName" … %>
B. Add the following code segment to the Load event of each page on the Web site.
Page.Theme = ThemeName;
C. Add the following code segment to the PreInit event of each page on the Web site.
Page.Theme = ThemeName;
D. Add the following code segment to the Web site's configuration file.
<pages theme="ThemeName" />
Answer: C
2. Your Web site uses custom Themes. Your Web site must support additional Themes based on the user's company name.
The company name is set when a user logs on to the Web site. The company's Theme name is stored in a variable named ThemeName.
You need to use this variable to dynamically set the Web site's Theme.
What should you do?
A. Add the following code segment to the markup source of each page on the Web site.
<%@ Page Theme="ThemeName" … %>
B. Add the following code segment to the Load event of each page on the Web site.
Page.Theme = ThemeName
C. Add the following code segment to the PreInit event of each page on the Web site.
Page.Theme = ThemeName
D. Add the following code segment to the Web site's configuration file.
<pages theme="ThemeName" />
Answer: C
3. You write a Web application. This application must support multiple languages. You store the localized strings in the application as resources. You want these resources to be accessed according to a users language preference. You create the following resource files in the App_GlobalResources folder of your application.
Each resource file stores a localized version of the following strings: Name, E-mail, Address, and Phone. You create a Web Form that contains one label for each of these strings.
You need to ensure that the correct localized version of each string is displayed in each label, according to a users language preference.
What should you do?
A. Add the following configuration section to the Web.config file.
<globalization culture="Auto" />
B. Set the directive for each page in your site as follows:
<%@ Page UICulture="Auto" %>
C. Add the following code segment to the pages load event.
lblName.Text = @"{myStrings}Name";
lblAddress.Text = @"{myStrings}Address";
lblEmail.Text = @"{myStrings}Email";
lblPhone.Text = @"{myStrings}Phone";
D. Add the following code segment to the pages load event.
lblName.Text = Resources.myStrings.Name;
lblAddress.Text = Resources.myStrings.Address;
lblEmail.Text = Resources.myStrings.Email;
lblPhone.Text = Resources.myStrings.Phone;
Answer: D
4. You write a Web application. This application must support multiple languages. You store the localized strings in the application as resources. You want these resources to be accessed according to a users language preference. You create the following resource files in the App_GlobalResources folder of your application.
Each resource file stores a localized version of the following strings: Name, E-mail, Address, and Phone. You create a Web Form that contains one label for each of these strings.
You need to ensure that the correct localized version of each string is displayed in each label, according to a users language preference.
What should you do?
A. Add the following configuration section to the Web.config file.
<globalization culture="Auto" />
B. Set the directive for each page in your site as follows:
<%@ Page UICulture="Auto" %>
C. Add the following code segment to the pages load event.
lblName.Text = "{myStrings}Name"
lblAddress.Text = "{myStrings}Address"
lblEmail.Text = "{myStrings}Email"
lblPhone.Text = "{myStrings}Phone"
D. Add the following code segment to the pages load event.
lblName.Text = Resources.myStrings.Name
lblAddress.Text = Resources.myStrings.Address
lblEmail.Text = Resources.myStrings.Email
lblPhone.Text = Resources.myStrings.Phone
Answer: D
5. You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults.
You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form.
Which code segment should you use?
A. protected void Page_Error(object sender, EventArgs e) {
lblResults.Text = e.ToString();
e=null;
}
B. protected void Page_Error(object sender, EventArgs e) {
lblResults.Text = Server.GetLastError().ToString();
Server.ClearError();
}
C. protected void Page_Error(object sender, EventArgs e) {
Response.Write(e.ToString());
e=null;
}
D. protected void Page_Error(object sender, EventArgs e) {
Response.Write(Server.GetLastError().ToString());
Server.ClearError();
}
Answer: D
6. You create a Web Form. The Web Form allows users to calculate values and display the results in a label named lblResults.
You need to capture all unhandled exceptions on the Web Form through the Error event. The Error event must capture each unhandled exception and display it on the Web Form.
Which code segment should you use?
A. Protected Sub Page_Error(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Error
lblResults.Text = e.ToString()
e = Nothing
End Sub
B. Protected Sub Page_Error(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Error?
lblResults.Text = Server.GetLastError().ToString()
Server.ClearError()
End Sub
C. Protected Sub Page_Error(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Error?
Response.Write(e.ToString())
e = Nothing
End Sub
D. Protected Sub Page_Error(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Error
Response.Write(Server.GetLastError().ToString())
Server.ClearError()
End Sub
Answer: D
7. You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database.
When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields.
You need to ensure that the Web Form does not update if the user has not entered data in all of the fields.
Which code segment should you use?
A. protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {
foreach (DictionaryEntry entry in e.Keys) {
if (entry.Value.ToString() == System.String.Empty) {
e.Cancel = true;
return;
}
}
}
B. protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e) {
foreach (DictionaryEntry entry in e.NewValues) {
if (entry.Value.Equals("")) {
e.KeepInEditMode = true;
return;
}
}
}
C. protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) {
foreach (DictionaryEntry entry in e.NewValues) {
if (entry.Value.Equals("")) {
e.Cancel = true;
return;
}
}
}
D. protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs e) {
foreach (DictionaryEntry entry in e.Keys) {
if (entry.Value.ToString() == System.String.Empty) {
e.KeepInEditMode = true;
return;
}
}
}
Answer: C
8. You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database.
When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields.
You need to ensure that the Web Form does not update if the user has not entered data in all of the fields.
Which code segment should you use?
A. Protected Sub FormView1_ItemUpdating(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) _
Handles FormView1.ItemUpdating
Dim entry As DictionaryEntry
For Each entry In e.Keys
If entry.Value.ToString() = System.String.Empty Then
e.Cancel = True
Return
End If
Next entry
End Sub
B. Protected Sub FormView1_ItemUpdated(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs) _
Handles FormView1.ItemUpdated
Dim entry As DictionaryEntry
For Each entry In e.NewValues
If entry.Value.Equals("") Then
e.KeepInEditMode = True
Return
End If
Next entry
End Sub
C. Protected Sub FormView1_ItemUpdating(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.FormViewUpdateEventArgs) _
Handles FormView1.ItemUpdating
Dim entry As DictionaryEntry
For Each entry In e.NewValues
If entry.Value.Equals("") Then
e.Cancel = True
Return
End If
Next entry
End Sub
D. Protected Sub FormView1_ItemUpdated(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.FormViewUpdatedEventArgs) _
Handles FormView1.ItemUpdated
Dim entry As DictionaryEntry
For Each entry In e.Keys
If entry.Value.ToString() = System.String.Empty Then
e.KeepInEditMode = True
Return
End If
Next entry
End Sub
Answer: C
9. You are creating a Web Form. You write the following code segment to create a SqlCommand object.
You need to display the number of customers in the Customers table.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. object customerCount = cmd.ExecuteScalar();
lblCompanyName.Text = customerCount.ToString();
B. int customerCount = cmd.ExecuteNonQuery();
lblCompanyName.Text = customerCount.ToString();
C. SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
lblCompanyName.Text = dr[0].ToString();
D. SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
lblCompanyName.Text = dr.ToString();
Answer: A AND C
10. You are creating a Web Form. You write the following code segment to create a SqlCommand object.
You need to display the number of customers in the Customers table.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Dim customerCount As Object = cmd.ExecuteScalar()
lblCompanyName.Text = customerCount.ToString()
B. Dim customerCount As Integer = cmd.ExecuteNonQuery()
lblCompanyName.Text = customerCount.ToString()
C. Dim dr As SqlDataReader = cmd.ExecuteReader()
dr.Read()
lblCompanyName.Text = dr(0).ToString()
D. Dim dr As SqlDataReader = cmd.ExecuteReader()
dr.Read()
lblCompanyName.Text = dr.ToString()
Answer: A AND C
11. You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.
IAsyncResult ar = cmd.BeginExecuteReader();
You need to execute a method named DoWork() that takes one second to run while the SQL query is executing. DoWork() must run as many times as possible while the SQL query is executing.
Which code segment should you use?
A. while (ar.AsyncWaitHandle == null) {
DoWork();
}
dr = cmd.EndExecuteReader(ar);
B. while (!ar.IsCompleted) {
DoWork();
}
dr = cmd.EndExecuteReader(ar);
C. while (Thread.CurrentThread.ThreadState == ThreadState.Running) {
DoWork();
}
dr = cmd.EndExecuteReader(ar);
D. while (!ar.AsyncWaitHandle.WaitOne()) {
DoWork();
}
dr = cmd.EndExecuteReader(ar);
Answer: B
12. You have an SQL query that takes one minute to execute. You use the following code segment to execute the SQL query asynchronously.
Dim ar As IAsyncResult = cmd.BeginExecuteReader()
You need to execute a method named DoWork() that takes one second to run while the SQL query is executing. DoWork() must run as many times as possible while the SQL query is executing.
Which code segment should you use?
A. While ar.AsyncWaitHandle Is Nothing
DoWork()
End While
dr = cmd.EndExecuteReader(ar)
B. While Not ar.IsCompleted
DoWork()
End While
dr = cmd.EndExecuteReader(ar)
C. While Thread.CurrentThread.ThreadState = ThreadState.Running
DoWork()
End While
dr = cmd.EndExecuteReader(ar)
D. While Not ar.AsyncWaitHandle.WaitOne()
DoWork()
End While
dr = cmd.EndExecuteReader(ar)
Answer: B
13. You create a Web Form that displays a GridView. The GridViews data source is a DataSet named dsOrders. The DataSet contains two DataTables named Orders and OrderDetails. You create a relation between the two DataTables using the following code segment. (Line numbers are included for reference only.)
You need to find the cause of the exception being raised in line 05.
What should you do?
A. Ensure that the child column and the parent column have the same names.
B. Ensure that the child table and the parent table have the same names.
C. Ensure that the child column and the parent column have the same data types.
D. Ensure that each row in the child table has a corresponding row in the parent table.
E. Ensure that the tables have an explicit relationship defined by a foreign key constraint in the database.
Answer: C
14. You create a Web Form that displays a GridView. The GridView's data source is a DataSet named dsOrders. The DataSet contains two DataTables named Orders and OrderDetails. You create a relation between the two DataTables using the following code segment. (Line numbers are included for reference only.)
You need to find the cause of the exception being raised in line 05.
What should you do?
A. Ensure that the child column and the parent column have the same names.
B. Ensure that the child table and the parent table have the same names.
C. Ensure that the child column and the parent column have the same data types.
D. Ensure that each row in the child table has a corresponding row in the parent table.
E. Ensure that the tables have an explicit relationship defined by a foreign key constraint in the database.
Answer: C
15. You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.)
You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed.
What should you do?
A. Add the following code segment after line 05.
dc.ExtendedProperties["Total"] = "Price * Quantity";
B. Add the following code segment after line 05.
dc.Expression = "Price * Quantity";
C. Write an event handler for the DataTable's TableNewRow event that updates the row's Total.
D. Write an event handler for the DataTable's ColumnChanged event that updates the row's Total.
Answer: B
16. You are creating a DataTable. You use the following code segment to create the DataTable. (Line numbers are included for reference only.)
You need to ensure that the Total column is set to the value of the Price column multiplied by the Quantity column when new rows are added or changed.
What should you do?
A. Add the following code segment after line 05.
dc.ExtendedProperties("Total") = "Price * Quantity"
B. Add the following code segment after line 05.
dc.Expression = "Price * Quantity"
C. Write an event handler for the DataTable's TableNewRow event that updates the row's Total.
D. Write an event handler for the DataTable's ColumnChanged event that updates the row's Total.
Answer: B
17. You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that is bound to a GridView. DataTable has the following four rows.
The user utilizes a Web Form to delete the first product.
You need to set the RowStateFilter property of the DataTables DefaultView so that only products that have not been deleted are shown.
To which value should you set the DataTabless DefaultView.RowStateFilter?
A. DataViewRowState.ModifiedOriginal;
B. DataViewRowState.ModifiedCurrent;
C. DataViewRowState.CurrentRows;
D. DataViewRowState.Added;
Answer: C
18. You are creating a Web Form. The Web Form allows users to rename or delete products in a list. You create a DataTable named dtProducts that is bound to a GridView. DataTable has the following four rows.
The user utilizes a Web Form to delete the first product.
You need to set the RowStateFilter property of the DataTables DefaultView so that only products that have not been deleted are shown.
To which value should you set the DataTabless DefaultView.RowStateFilter?
A. DataViewRowState.ModifiedOriginal
B. DataViewRowState.ModifiedCurrent
C. DataViewRowState.CurrentRows
D. DataViewRowState.Added
Answer: C
19. Your Web site processes book orders. One of the application methods contains the following code segment.
You need to remove the discount element from XmlDocument.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.XmlNode root = doc.DocumentElement;
root.RemoveChild(root.FirstChild);
B.XmlNode root = doc.DocumentElement;
root.RemoveChild(root.SelectSingleNode("discount"));
C.doc.RemoveChild(doc.FirstChild);
D.doc.DocumentElement.RemoveChild(doc.FirstChild);
Answer: B AND A
20. Your Web site processes book orders. One of the application methods contains the following code segment.
You need to remove the discount element from XmlDocument.
Which two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Dim root As XmlNode = doc.DocumentElement
root.RemoveChild(root.FirstChild)
B. Dim root As XmlNode = doc.DocumentElement
root.RemoveChild(root.SelectSingleNode("discount"))
C.doc.RemoveChild(doc.FirstChild)
D.doc.DocumentElement.RemoveChild(doc.FirstChild)
Answer: B AND A
21. You load an XmlDocument named doc with the following XML.
You need to use an Xpath query string to select the two book nodes.
Which code segment should you use?
A.XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes(".");
B.XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("book");
C.XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("bookstore//book");
D.XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("books/book");
Answer: D
22. You load an XmlDocument named doc with the following XML.
You need to use an Xpath query string to select the two book nodes.
Which code segment should you use?
A. Dim root As XmlElement = doc.DocumentElement
Dim nodes As XmlNodeList = root.SelectNodes(".")
B. Dim root As XmlElement = doc.DocumentElement
Dim nodes As XmlNodeList = root.SelectNodes("book")
C. Dim root As XmlElement = doc.DocumentElement
Dim nodes As XmlNodeList = root.SelectNodes("bookstore//book")
D. Dim root As XmlElement = doc.DocumentElement
Dim nodes As XmlNodeList = root.SelectNodes("books/book")
Answer: D
23. You load an XmlDocument named doc with the following XML.
You need to change the value for the genre attribute to NA for all book attributes.
First, you add the following code segment to your class.
XmlElement root = doc.DocumentElement;
XmlNodeList nodes = root.SelectNodes("books/book");
Which additional two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.foreach (XmlNode node in nodes){
node.Attributes[0].Value = "NA";
}
B.foreach (XmlNode node in nodes){
node.Attributes[1].Value = "NA";
}
C.foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("/genre");
genre.Value = "NA";
}
D.foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("@genre");
genre.Value = "NA";
}
E.foreach (XmlNode node in nodes){
XmlNode genre = node.SelectSingleNode("genre");
genre.Value = "NA";
}
Answer: A AND D
24. You load an XmlDocument named doc with the following XML.
You need to change the value for the genre attribute to NA for all book attributes.
First, you add the following code segment to your class.
Dim root As XmlElement = doc.DocumentElement
Dim nodes As XmlNodeList = root.SelectNodes("books/book")
Which additional two code segments can you use to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Dim node As XmlNode
For Each node In nodes
node.Attributes(0).Value = "NA"
Next node
B. Dim node As XmlNode
For Each node In nodes
node.Attributes(1).Value = "NA"
Next node
C. Dim node As XmlNode
For Each node In nodes
Dim genre As XmlNode = node.SelectSingleNode("/genre")
genre.Value = "NA"
Next node
D. Dim node As XmlNode
For Each node In nodes
Dim genre As XmlNode = node.SelectSingleNode("@genre")
genre.Value = "NA"
Next node
E. Dim node As XmlNode
For Each node In nodes
Dim genre As XmlNode = node.SelectSingleNode("genre")
genre.Value = "NA"
Next node
Answer: A AND D
25. You develop a Web control to manage credit card information. The Web control is shown in the exhibit. (Click the Exhibit button.)
You register the control on the Web Form by using the following code segment.
You need to declare the control on the Web Form.
Which code segment should you use?
A. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server" Name="test">
</cc1:CreditCardDetails>
<asp:TextBox ID="TxtName" runat="server" Text="<%#CreditCardDetails1.Name%>">
</asp:TextBox>
B. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server" Name="%#Container.Name%">
</cc1:CreditCardDetails>
C. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server"
Text="<%#Container.Name%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
D. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server"
Text="<%#Container.Template%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
Answer: C
26. You develop a Web control to manage credit card information. The Web control is shown in the exhibit. (Click the Exhibit button.)
You register the control on the Web Form by using the following code segment.
You need to declare the control on the Web Form.
Which code segment should you use?
A. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server" Name="test"></cc1:CreditCardDetails>
<asp:TextBox ID="TxtName" runat="server" Text="<%#CreditCardDetails1.Name%>"></asp:TextBox>
B. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server"
Name="<%#Container.Name%>"></cc1:CreditCardDetails>
C. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server" Text="<%#Container.Name%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
D. <cc1:CreditCardDetails ID="CreditCardDetails1" runat="server">
<Template>
<asp:TextBox ID="TxtName" runat="server" Text="<%#Container.Template%>"></asp:TextBox>
</Template>
</cc1:CreditCardDetails>
Answer: C
27. You define a composite control to capture a users birth date. You use the following class declaration.
You need to ensure that the Web control supports templates.
Which four code segments should you use? (Each correct answer presents part of the solution. Choose four.)
To answer, move the appropriate code segments from the list of code segments to the answer area.
List of Code Segments Answer Area
A. private Label _prompt = new Label();
private TextBox _date = new TextBox();
B. private string _prompt = "Enter date of birth ";
private DateTime _date = DateTime();
private Itemplate _template = null;
C. [Bindable(true)]
public string Prompt {
get {
EnsureChildControls();
return _prompt.Text;
}
set {
EnsureChildControls();
_prompt.Text = value;
}
}
[Bindable(true)]
public string Date {
get {
EnsureChildControls();
return _date.Text;
}
set {
EnsureChildControls();
_date.Text = value;
}
}
D. [Bindable(true)]
public string Prompt {
get {
EnsureChildControls();
return _prompt;
}
set {
EnsureChildControls();
_prompt = value;
}
}
[Bindable(true)]
public DateTime Date {
get {
EnsureChildControls();
return _date;
}
set {
EnsureChildControls();
_date = value;
}
}
E. [Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateContainer(typeof(DateOfBirth))]
public Itemplate Template {
get {
return _template;
}
set {
_template = value;
}
}
F. protected override void CreateChildControls() {
if (Template != null) {
Controls.Clear();
_template.InstantiateIn(this);
}
}
protected override void CreateChildControls() {
this.Controls.Add(_prompt);
this.Controls.Add(_date);
base.CreateChildControls();
}
Answer: B AND D AND E AND F
28. You define a composite control to capture a users birth date. You use the following class declaration.
You need to ensure that the Web control supports templates.
Which four code segments should you use? (Each correct answer presents part of the solution. Choose four.)
To answer, move the appropriate code segments from the list of code segments to the answer area.
List of Code Segments Answer Area
A.Private _prompt As New Label()
Private _date As New TextBox()
B.Private _prompt As String = "Please enter " & _
your date of birth: "
Private _date As New DateTime()
Private _template As Itemplate = Nothing
C.<Bindable(True)> _
Public Property Prompt() As String
Get
EnsureChildControls()
Return _prompt.Text
End Get
Set(ByVal value As String)
EnsureChildControls()
_prompt.Text = value
End Set
End Property
<Bindable(True)> _
Public Property [Date]() As String
Get
EnsureChildControls()
Return _date.Text
End Get
Set(ByVal value As String)
EnsureChildControls()
_date.Text = value
End Set
End Property
D.<Bindable(True)> _
Public Property Prompt() As String
Get
EnsureChildControls()
Return _prompt
End Get
Set(ByVal value As String)
EnsureChildControls()
_prompt = value
End Set
End Property
<Bindable(True)> _
Public Property [Date]() As DateTime
Get
EnsureChildControls()
Return _date
End Get
Set(ByVal value As DateTime)
EnsureChildControls()
_date = value
End Set
End Property
E.<Browsable(False),
PersistenceMode(PersistenceMode.InnerProperty),
TemplateContainer(GetType(DateOfBirth))> _
Public Property Template() As Itemplate
Get
Return _template
End Get
Set(ByVal value As Itemplate)
_template = value
End Set
End Property
F.Protected Overrides Sub CreateChildControls()
If Not (Template Is Nothing) Then
Controls.Clear()
_template.InstantiateIn(Me)
End If
End Sub
Protected Overrides Sub CreateChildControls()
Me.Controls.Add(_prompt)
Me.Controls.Add(_date)
MyBase.CreateChildControls()
End Sub
Answer: B AND D AND E AND F
29. You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives.
You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site.
Which code segment should you use?
A. <%@ Page Language="C#" Theme="article"%>
B. <%@ Page Language="C#" MasterPageFile="~/article.master"%>
C. <%@ Page Language="C#" ie:MasterPageFile="~/article.master"%>
D. <%@Page Language="C#" all:MasterPageFile="~/article.master"%>
Answer: B
30. You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives.
You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site.
Which code segment should you use?
A. <%@ Page Language="VB" Theme="article"%>
B. <%@ Page Language="VB" MasterPageFile="~/article.master"%>
C. <%@ Page Language="VB" ie:MasterPageFile="~/article.master"%>
D. <%@Page Language="VB" all:MasterPageFile="~/article.master"%>
Answer: B


