Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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 September 16th, 2003, 11:40 AM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7 Compilation Error

In the event.aspx example, I get the following error: BC30451: Name 'Message' is not declared on line 4.

I get the same error in chapter 2's datacontrol2.aspx example stating that DataGrid1 is not declared.

Am I missing something?

Bill
 
Old September 16th, 2003, 12:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What you are missing is posting some code here ;)

I don't have the book here, so it's hard to tell what the problem can be. If you post the relevant part of the code, it's easier for us to see what the problem is.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 16th, 2003, 02:08 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, This is my first time posting and was trying to keep it short. Here is my code:

<script language="vb" runat="server">
    Sub ClickHandler(Sender As Object, E as EventArgs)
        If ExtraInfoBox.Checked then
            Message.Text = "<br /><br />You will hear from us shortly"
        Else
            Message.Text = "<br /><br />You will not receive any further" & _
                " information from us"
        End If
    End Sub
</script>

<html>
    <head>
      <title>Server-side event processing example</title>
    </head>
    <body>
      <form runat="server">
        <asp:CheckBox id="ExtraInfoBox" Text=
        "Click here to receive extra information" Runat="server" />
        <br /><br />
        <asp:Button id="Button1" Text="Click Here to Submit" onclick="ClickHandler" runat="server"/>
      </form>
    </body>
</html>
 
Old September 16th, 2003, 02:39 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured out my error! When typing in the code I skipped the following line:

<asp:Label id=Message" runat="server"/>

I didn't realize this line was actually declaring the objects that could be referenced in the script above.

Bill





Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation Error allyant ASP.NET 2.0 Basics 1 August 5th, 2006 05:51 PM
Compilation Error don baroo ASP.NET 1.0 and 1.1 Basics 2 August 26th, 2005 08:05 PM
Chapter 18-Sample App-Compilation pdtt JSP Basics 5 December 12th, 2004 10:40 PM





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