Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: any codebehind page just won't work


Message #1 by visual_ben@h... on Fri, 3 Aug 2001 02:11:26
I have been trying to set up a code behind page and have tried my own code 

plus downloads from 3 different places- it just won't work!!



The top of my aspx page looks like this (from 4 guys from rolla)



<%@ Page language="c#" Codebehind="CodeBehind.cs" 

Inherits="ASPPlus.CodeBehind" %>



My c# page looks like this (i have removed some db code beacuse i am just 

trying to get the code behind structure to work)



namespace ASPPlus

{

using System;

using System.Data;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;



/// <summary>

///    Summary description for CodeBehind.

/// </summary>

public class CodeBehind : System.Web.UI.Page

{

	public System.Web.UI.WebControls.Label Message;

	public System.Web.UI.HtmlControls.HtmlTable tblSignIn;

	public System.Web.UI.WebControls.TextBox txtLogin;

	public System.Web.UI.WebControls.RequiredFieldValidator RFVLogin;

	public System.Web.UI.WebControls.TextBox txtPassword;

	public System.Web.UI.WebControls.RequiredFieldValidator 

RFVPassword;

	public System.Web.UI.WebControls.Button btnSignIn;

	



	protected void Page_Load(object sender, EventArgs e)

    	{

        	if (!IsPostBack)

        	{

			Message.Text = "Enter Login and Password";

        	}

    	}



	protected void btnSignIn_Click(Object obj, EventArgs e)

	{

		



	}

}

}





my batch file looks like this



c:\winnt\microsoft.net\framework\v1.0.2914

\csc /out:c:\inetpub\wwwroot\dotnetnow\codebehind\Codebehind.dll /r:System.

dll,System.web.dll,System.Data.dll /t:library 

c:\inetpub\wwwroot\dotnetnow\codebehind\Codebehind.cs



the dll compiles and i put it in the bin directory below the virtual 

directory



when i run the .aspx page i get the following error



Parser Error 

Description: An error occurred during the parsing of a resource required 

to service this request. Please review the following specific parse error 

details and modify your source file appropriately. 



Parser Error Message: 'ASPPlus' is not a valid type.



Source Error: 





Line 1:  <%@ Page language="c#" Codebehind="CodeBehind.cs" 

Inherits="ASPPlus" %>

Line 2:  <HTML><HEAD>

Line 3:  <meta content="Microsoft Visual Studio 7.0" name=GENERATOR

 

please anyone can you help me



ben

Message #2 by visual_ben@h... on Fri, 3 Aug 2001 02:28:50
sorry guys here is a correction- the error actually reads





Parser Error 

Description: An error occurred during the parsing of a resource required 

to service this request. Please review the following specific parse error 

details and modify your source file appropriately. 



Parser Error Message: 'ASPPlus.CodeBehind' is not a valid type.



Source Error: 





Line 1:  <%@ Page language="c#" Codebehind="CodeBehind.cs" 

Inherits="ASPPlus.CodeBehind" %>

Line 2:  <HTML><HEAD>

Line 3:  <meta content="Microsoft Visual Studio 7.0" name=GENERATOR>

 

ben

 

Message #3 by Tim Heuer <TimH@i...> on Thu, 2 Aug 2001 18:44:59 -0700
This is typically because you have not compiled/built the web project yet.

If you have not, then your current code will not work.  To get your page to

work w/out compiling...change to:



<%@ Page language=3D"C#" codebehind=3D"CodeBehind.cs"

Inherits=3D"ASPPlus.CodeBehind" src=3D"CodeBehind.cs" %>



note the additional "src" attribute.  In an uncompiled app, this instructs

the page where to get the source.  On a side note, I'd make sure you don't

name pages, source pages or classes after keywords, such as Code 

behind...you may run into problems...



-----Original Message-----

From: visual_ben@h... [mailto:visual_ben@h...]

Sent: Thursday, August 02, 2001 7:11 PM

To: ASP+

Subject: [aspx] any codebehind page just won't work





I have been trying to set up a code behind page and have tried my own code

plus downloads from 3 different places- it just won't work!!



The top of my aspx page looks like this (from 4 guys from rolla)



<%@ Page language=3D"c#" Codebehind=3D"CodeBehind.cs"

Inherits=3D"ASPPlus.CodeBehind" %>



My c# page looks like this (i have removed some db code beacuse i am just

trying to get the code behind structure to work)



namespace ASPPlus

{

using System;

using System.Data;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;



/// <summary>

///    Summary description for CodeBehind.

/// </summary>

public class CodeBehind : System.Web.UI.Page

{

	public System.Web.UI.WebControls.Label Message;

	public System.Web.UI.HtmlControls.HtmlTable tblSignIn;

	public System.Web.UI.WebControls.TextBox txtLogin;

	public System.Web.UI.WebControls.RequiredFieldValidator RFVLogin;

	public System.Web.UI.WebControls.TextBox txtPassword;

	public System.Web.UI.WebControls.RequiredFieldValidator

RFVPassword;

	public System.Web.UI.WebControls.Button btnSignIn;

=09



	protected void Page_Load(object sender, EventArgs e)

    	{

        	if (!IsPostBack)

        	{

			Message.Text =3D "Enter Login and Password";

        	}

    	}



	protected void btnSignIn_Click(Object obj, EventArgs e)

	{

	=09



	}

}

}





my batch file looks like this



c:\winnt\microsoft.net\framework\v1.0.2914

\csc /out:c:\inetpub\wwwroot\dotnetnow\codebehind\Codebehind.dll /r:System.

dll,System.web.dll,System.Data.dll /t:library

c:\inetpub\wwwroot\dotnetnow\codebehind\Codebehind.cs



the dll compiles and i put it in the bin directory below the virtual directory



when i run the .aspx page i get the following error



Parser Error

Description: An error occurred during the parsing of a resource required

to service this request. Please review the following specific parse error

details and modify your source file appropriately.



Parser Error Message: 'ASPPlus' is not a valid type.



Source Error:





Line 1:  <%@ Page language=3D"c#" Codebehind=3D"CodeBehind.cs"

Inherits=3D"ASPPlus" %>

Line 2:  <HTML><HEAD>

Line 3:  <meta content=3D"Microsoft Visual Studio 7.0" name=GENERATOR



please anyone can you help me



ben


  Return to Index