Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2005, 02:02 AM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Very beginner - Result didn't show in the browser

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="http://schemas.microsoft.com/intellisense/ie5">
    </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?
 
Old February 17th, 2005, 09:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you give us a little more information?
Are you viewing the page in a browser?
I'm assuming IIS is installed and what order did you install everything?
 
Old February 17th, 2005, 02:21 PM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I viewing the page in a browser.

I have IIS, .NET Framework 1.1 installed. The order of software installation, I followed the Microsoft's instruction. Hopes this is what you mean.
 
Old February 17th, 2005, 02:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you view HTML on your page or is it just ASP.Net code that's not showing?

 
Old February 18th, 2005, 02:38 AM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you view HTML on your page or is it just ASP.Net code that's not showing?

I can view HTML code but I think ASP.NET code didn't work becuase HTML didn't show value of "Label1.Text".

Here is the HTML that shown:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>test</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="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body>
        <span id="lblMessage"></span>
    </body>
</HTML>
 
Old February 18th, 2005, 09:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

 try this:

1) Open a command window. (Click Start, click Run, type cmd, and then click OK.)
2) Navigate to the directory of the Aspnet_regiis.exe version you want to use. Remember that each version of the .NET Framework comes with its own version.

The file is usually located in the following directory:
for XP c:\windows\Microsoft.NET\Framework\<versionNumber>
for 2000 c:\winnt\microsoft.net\framework\<versionNumber>

Then type aspnet_regiis.exe -i

 
Old February 19th, 2005, 02:36 PM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did but it still won't show anything. :(
 
Old February 22nd, 2005, 12:08 PM
Authorized User
 
Join Date: Jun 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Somebody told me that because this line "<%@ Page language="c#" Codebehind="listing06.aspx.cs" AutoEventWireup="false" Inherits="Day4.listing06" %>"

AutoEventWireup should be true.

Thank you tried to help anayway.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Show result during SQL statement rtr1900 ASP.NET 2.0 Basics 0 December 7th, 2006 06:51 AM
how to show result of MS Analysis service to WEB? rosejeep C# 0 November 8th, 2006 09:27 PM
Database unable to show result. (ASP.NET C#) richie86 ASP.NET 1.0 and 1.1 Basics 3 November 10th, 2005 01:59 PM
Show result from query akibaMaila VB.NET 2002/2003 Basics 2 January 18th, 2005 12:43 PM
problem in show result (vb.net) q8z Beginning VB 6 0 October 27th, 2004 03:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.