two errors:1. use "=" instead of "-":
<asp:label id="time" runat-"server"/>
===>
<asp:label id="time" runat="server"/>2. C# is case-sensitive, use "Second":
DateTime.Now.second.ToString();
===>
DateTime.Now.Second.ToString();
<asp:label id="time" runat-"server"/>
===>
<asp:label id="time" runat="server"/>2. C# is case-sensitive, use "Second":
DateTime.Now.second.ToString();
===>
DateTime.Now.Second.ToString();
void Page_Load()
{
time.Text=DateTime.Now.Hour.ToString()+":"+
DateTime.Now.Minute.ToString()+":"+
DateTime.Now.Second.ToString();
}
</script>
<html>
<head><title>The Punctual Web Server</title></head>
<body>
<h1>Welcome</h1>
In WebServerLand the time is currently:
<asp:label id="time" runat="server"/>
</body>
</html>显示结果还是一个样,请用有没有调试这些代码的工具?简单教一下他的使用!
也可以,你是新建了虚拟目录吧?运行
aspnet_regiis -i