Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parser error with Inherit

Status
Not open for further replies.

jebenson

Technical User
Feb 4, 2002
2,956
0
0
US
I am getting a parser error:

"Could not load type 'TPFA.survey'."

From this line:

<%@ Page language="c#" CodeBehind="Survey.aspx.cs" AutoEventWireup="false" Inherits="TPFA.survey" %>

I try removing the Inherits, but it gets added back in every time I save.

The code behind module looks like this:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace TPFA
{
/// <summary>
/// Summary description for _default.
/// </summary>
public class survey : System.Web.UI.Page
{
protected System.Web.UI.WebControls.CheckBox Checkbox1;
protected System.Web.UI.WebControls.CheckBox Checkbox2;
protected System.Web.UI.WebControls.CheckBox Checkbox3;

etc., etc.

I'm very new to ASP (but not to .NET) and I have no idea what is going on here. I have other pages on the site (I'm trying to maintain/add to a site that I didn't create) that use the same general code (only the names are different), and those pages work fine.

Can someone explain this to me?

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
It's basically the namespace that the page is stored in. Try removing the "TPFA." as it may not be part of any namespace.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Hey, any relation to jbenson001?

Anyway, I noticed you say you are "adding a page to an existing site". Out of curiosity, did you recompile the web application?

The error message you're getting indicates it can't load the type from the assemblies in the bin directory so the solution is most likely related to the lack of a compiled assembly for the page.

If you can get your hands on the original code, you should just be able to recompile and redeploy, otherwise you can either create a new assembly/web project for the page and dump the resulting dll into the bin directory of the site (along with the aspx file), or set the Src attribute of the .aspx file's @Page directive and delete its Inherits attribute (to force dynamic compilation).

I must admit, however, that I've never tried to do the latter option so I'm not sure how well it works.
 
PS- When I say "along with the aspx file" I don't mean you should put the aspx file in the bin directory, I mean you should deploy it to the site somewhere.
 
We really need more info here. Are you trying to bring this project out of SourceSafe to your local box to administer? Is the Project/Solution write protected? Are there any third party controls in use that you are not referencing in your project? I've been through this one and the solution is "DOH!". Obviously you have access to the source code but is it through a VS Project? What's your global.asax looking like (locally)?


Vince
 
Thanks for the replies. I think the problem was with the compiling, as BoulderBum suggested. However, I'm not sure becaue the problem "fixed itself" (i.e., I don't know what I did, but it works now).

Again, thanks all.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top