Microsoft
70-515 · Question #14
You create an ASP.NET page that contains the following tag. <h1 id="hdr1" runat="server">Page Name</h1> You need to write code that will change the contents of the tag dynamically when the page is…
The correct answer is A. this.hdr1.InnerHtml = "Text"; C. HtmlGenericControl h1 = this.FindControl("hdr1") as. See the full explanation below for the reasoning.
Question
You create an ASP.NET page that contains the following tag. <h1 id="hdr1" runat="server">Page Name</h1> You need to write code that will change the contents of the tag dynamically when the page is loaded. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
Options
- Athis.hdr1.InnerHtml = "Text";
- B(hdr1.Parent as HtmlGenericControl).InnerText = "Text";
- CHtmlGenericControl h1 = this.FindControl("hdr1") as
- DHtmlGenericControl h1 = Parent.FindControl("hdr1") as
How the community answered
(28 responses)- A71% (20)
- B11% (3)
- D18% (5)
Community Discussion
No community discussion yet for this question.