I've got ASP.NET book for a while - just start reading it a few days. I'm using Visual Studio.NET 2003 on Windows XP.
I have some problem - I cannot see result of the code that I typed from the book. I've tried all the codes from few first chapters which's very easy writing "Hello World" - stuff like that. So I don't think it's a code. I think something in the setting in Visual Studio.NET or in my computer was not right. I went through VSS's Tools/Option but I have no clue what could have cause that.
Any codes similar to this one shown as blank page. It compiled - picked up all mistyped all right but it won't show the result!
Anyway, here is the code:
<%@ Page language="c#" Codebehind="listing06.aspx.cs" AutoEventWireup="false" Inherits="Day4.listing06" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs e)
{
DateTime Now = DateTime.Now;
int intHour = Now.Hour;
Label1.Text = "The time is now " + Now.ToString("T") + "<p>";
if (intHour < 12)
{
Label1.Text += "Good morning!";
}
else if (intHour > 12 & intHour < 18)
{
Label1.Text += "Good afternoon!";
}
else
{
Label1.Text += "Good evening!";
}
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>listing06</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content=" </HEAD>
<body>
<form runat="server">
<asp:Label ID="Label1" Runat="server" />
</form>
</body>
</HTML>
Another thing is "Statment Completion set to auto list members but it never list any members while I typing the code under <script>...</script> block (for example when I typed Response. and I supposed it show a list so I can select "Write") but it would list member of <asp:xxx>. Is it how it works?
I have some problem - I cannot see result of the code that I typed from the book. I've tried all the codes from few first chapters which's very easy writing "Hello World" - stuff like that. So I don't think it's a code. I think something in the setting in Visual Studio.NET or in my computer was not right. I went through VSS's Tools/Option but I have no clue what could have cause that.
Any codes similar to this one shown as blank page. It compiled - picked up all mistyped all right but it won't show the result!
Anyway, here is the code:
<%@ Page language="c#" Codebehind="listing06.aspx.cs" AutoEventWireup="false" Inherits="Day4.listing06" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs e)
{
DateTime Now = DateTime.Now;
int intHour = Now.Hour;
Label1.Text = "The time is now " + Now.ToString("T") + "<p>";
if (intHour < 12)
{
Label1.Text += "Good morning!";
}
else if (intHour > 12 & intHour < 18)
{
Label1.Text += "Good afternoon!";
}
else
{
Label1.Text += "Good evening!";
}
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>listing06</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content=" </HEAD>
<body>
<form runat="server">
<asp:Label ID="Label1" Runat="server" />
</form>
</body>
</HTML>
Another thing is "Statment Completion set to auto list members but it never list any members while I typing the code under <script>...</script> block (for example when I typed Response. and I supposed it show a list so I can select "Write") but it would list member of <asp:xxx>. Is it how it works?