Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the web page shown on the left below which uses a User Control. The Use

ID: 658224 • Letter: C

Question

Consider the web page shown on the left below which uses a User Control. The User Control design is shown on the right. The code behind for each is shown on the final exam (not provided here!). The are 10 places in the code where a property, method, event, or parameter value is missing. You will fill-in these 10 blanks.

Description:

In ?Testing Input?, the user types a Description and presses Set button. The value supplied appears in the UC in the label that says desc.

In ?User Control?, the user types a value abd presses Submit.

The UC stores the input value and fires an event.

The web page handles the event by putting the input value in the ?Testing Output? are in the textbox shown, txtInVal.

Explanation / Answer

As you have not provided the asp code I assume you need the asp code to generate this page, its controls and its events.

Below is the asp code:

<html>
<body>
<script type="text/javascript">

function setUCLabel()
{
var text=document.getElementById("txtDesc").value;
document.getElementById("lblDesc").value = text
}
</script>

<script runat="server">
Sub submit(s As Object, e As EventArgs)
txtInVal.Text=Request.Form("txtUc")
End Sub
</script>

<form runat="server">
<asp:Label ID="Label1" runat="server" Text="Testing Input:" Font-Bold="true" font-size="16px"></asp:Label><br/>
<asp:Label ID="Label2" runat="server" Text="Description: "></asp:Label>
<asp:TextBox id="txtDesc" runat="server" />
<asp:Button id="btnSet" Text="Set" runat="server"/><br/><br/><br/><br/><br/>

<asp:Label ID="Label3" runat="server" Text="User Control:" Font-Bold="true" font-size="16px"></asp:Label><br/>
<asp:Label ID="lblDesc" runat="server" Text="desc "></asp:Label>
<asp:TextBox id="txtUc" runat="server" /><br/><br/><br/><br/><br/>
<asp:Button id="btnSubmit" Text="Submit" runat="server"/><br/><br/><br/><br/><br/>

<asp:Label ID="Label4" runat="server" Text="Testing Output:" Font-Bold="true" font-size="16px"></asp:Label><br/>
<asp:Label ID="lbl5" runat="server" Text="Input Value "></asp:Label>
<asp:TextBox id="txtInVal" runat="server" /><br/><br/><br/><br/><br/>

</form>

</body>
</html>

Note: fill in the blanks is not possible is the asp code is not provided with the question.