📄 demo-modulosimple.aspx
字号:
<%@ Page Language="C#" %>
<script runat="server">
// demo of modulo where every third try displays an encouraging message
void Page_Load()
{
if (Page.IsPostBack)
{
Button1.Text = "Press the button again.";
lblTryCounter.Text = Convert.ToString(Convert.ToInt32(lblTryCounter.Text)+1);
if (Convert.ToInt32(lblTryCounter.Text)%3==0)
{
Button1.Text += "You'll be encouraged every third try.";
} //end if (Convert.ToInt32(lblTryCounter.Text)%3==0)
} //end if (Page.IsPostBack)
} //End Page_Load()
</script>
<html>
<head>
<title>Do Loop Example</title>
</head>
<body>
<form runat="server">
<asp:Button runat="server" ID="Button1" text="Just keep clicking me"></asp:Button>
<asp:label id="lblTryCounter" runat="server">0</asp:label>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -