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 August 4th, 2004, 11:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Where do you output this: Testing the data connection -->

I don't see that anywhere, could you post that code?

Brian
 
Old August 4th, 2004, 02:58 PM
Authorized User
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The CodeBehind file called "class1.cs":
========================================

using System;
using System.Data;
using System.Data.OleDb;
using System.Web.UI;
using System.Web.UI.WebControls;

public class Doit : Page
{
    public Label data_src;

    public void Page_Load()
    {
        Response.Write("This is the function page load");
        data_src.Text="This is the Text in my lavel";
    }
}



This is the ASPX file called "WebForm1.aspx":
==============================================

<%@ Page language="c#" Src="Class1.cs" CodeBehind="Class1.cs" Inherits="Doit" ResponseEncoding="windows-1255" %>

<HTML>
    <body>
        <h4>Testing the data connection -->
        <asp:label id="data_src" runat="server" /></h4>
    </body>
</HTML>

 
Old August 4th, 2004, 03:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

VS.NET can see Src and CodeBehind, but typically deal with the code behind page being WebForm1.aspx.cs...

I don't know if that's the issue or not. Maybe try to delete the page to the project and add the code again...

The two other things I was thinking:
1. Is the Doit class added as a reference in the references section, or is the name of the project added as a reference to the project (self-project reference)? That can cause this type of problem...
2. In the Inherits property, set it to "<name of project>.DoIt" or if you put a namespace around the class, to "<name of project>.<namespaces separated by a period>.Doit".

Brian
 
Old August 4th, 2004, 03:50 PM
Authorized User
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I try it out in the Visual Web Developer 2005 Express Edition Beta and made only few changes in the @Page directive so it's now:

<%@ Page language="c#" Src="Class1.aspx.cs" Inherits="MyName.Doit" ResponseEncoding="windows-1255" %>

and it's working great!!!


BTW - in the default the @Page directive looks different from VS.NET:
<%@ Page Language="C#" CompileWith="Class1.aspx.cs" ClassName="MyName.Doit" %>

and this default don't work for me. So strange!

I think I am going to stay with this lite version of VS.NET.
It has everything I need for learning at home.

Thanks a lot!!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
simply query calculations!!!!!! thedom Access 0 March 13th, 2007 06:37 PM
Name a range simply for each third cell wapfu Excel VBA 2 December 6th, 2006 03:04 PM
Simply Deleting Question - ThnX ! ank2go SQL Language 2 November 16th, 2004 04:55 PM
How to access Simply Accounting fields from Access lguzman Access VBA 4 September 16th, 2004 02:55 PM
problem on example code zerocold C# 0 July 15th, 2004 04:19 PM





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