-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmycontrol.ascx
49 lines (47 loc) · 1.14 KB
/
mycontrol.ascx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<%@ Control Language="C#" %>
<script runat="server">
public String Name {
get
{
return labelOutput.Text;
}
set
{
textName.Text = Server.HtmlEncode(value);
labelOutput.Text = Server.HtmlEncode(value);
}
}
void buttonDisplayName_Click(object sender, EventArgs e) {
labelOutput.Text = textName.Text;
}
</script>
<table>
<tbody>
<tr>
<td>
<b>Enter your name:</b></td>
</tr>
<tr>
<td>
<asp:TextBox id="textName"
runat="server">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:button id="buttonDisplayName"
onclick="buttonDisplayName_Click"
runat="server" text="Submit">
</asp:button>
</td>
</tr>
<tr>
<td><b>Hello,
<asp:Label id="labelOutput"
runat="server">
</asp:Label>.</b>
</td>
</tr>
</tbody>
</table>