File: web_linkbutton.aspx

package info (click to toggle)
xsp 2.10-2.4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,656 kB
  • sloc: cs: 11,307; xml: 8,481; sh: 4,378; perl: 1,189; makefile: 744; php: 6
file content (34 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (7)
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
<%@ Page Language="C#" %>
<%@ Register TagPrefix="mono" TagName="MonoSamplesHeader" src="~/controls/MonoSamplesHeader.ascx" %>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/mono-xsp.css">
<script runat="server">
	void Clicked (object sender, EventArgs e)
	{
	       label1.Text = " &lt;- you've just clicked it!";
	}

	void OnLb2Command (object sender, CommandEventArgs e)
	{
	       if (e.CommandName == "Remove_this") {
	              lb2.Visible = false;
	              label2.Text = "There used to be a link here, but you have removed it";
	       }
	}
</script>
<title>LinkButton as submit and command</title>
</head>
<body><mono:MonoSamplesHeader runat="server"/>
<form runat="server">
<asp:LinkButton id="lb1" Text="Click me!" OnClick="Clicked" runat="server"/>
<asp:Label id="label1" Text="" runat="server"/>
<br>
<asp:LinkButton id="lb2" CommandName="Remove_this" OnCommand="OnLb2Command" runat="server">
Remove this link.
</asp:LinkButton>
<asp:Label id="label2" Text="" runat="server"/>
</form>
</body>
</html>