Inheritance

A

Andrea Williams

I'm trying to add common functionality to each of my ASPX page, using inheritance from a project class out side my web class. When I do that, the Web Forms Designer does not load.

public class UserRegister : WebBaseClass

{

}

//In a different assembly



public class WebBaseClass : System.Web.UI.Page

{

}

Everything compiles and runs just fine, but the ASPX page doesn't show me the "Design" and "HTML" buttons at the bottom any more, and I get the following error when opening the ASPX file:

The file could not be loaded into the Web Forms Designer. Please correct the following error and then try loading it again:

An exception occurred while trying to create an instance of ASPCommon. The exception was "Culture name US-EN is not supported."

Parameter name: name".

Make sure all of the classes used in the page are built or referenced in the project.

I at first thought it was because I had the page's inheritance three levels deep, but now I've determined that it's because the class that inherits System.Web.UI.Page is not in the same assembly.

Has anyone else found this problem, and if so, what was done to fix the issue?

Thanks!

Andrea
 
B

bruce barker

when your page is hosted by the designer, Response, Request, etc, are all null. you have to code for this case.

-- bruce (sqlwork.com)


I'm trying to add common functionality to each of my ASPX page, using inheritance from a project class out side my web class. When I do that, the Web Forms Designer does not load.

public class UserRegister : WebBaseClass

{

}

//In a different assembly



public class WebBaseClass : System.Web.UI.Page

{

}

Everything compiles and runs just fine, but the ASPX page doesn't show me the "Design" and "HTML" buttons at the bottom any more, and I get the following error when opening the ASPX file:

The file could not be loaded into the Web Forms Designer. Please correct the following error and then try loading it again:

An exception occurred while trying to create an instance of ASPCommon. The exception was "Culture name US-EN is not supported."

Parameter name: name".

Make sure all of the classes used in the page are built or referenced in the project.

I at first thought it was because I had the page's inheritance three levels deep, but now I've determined that it's because the class that inherits System.Web.UI.Page is not in the same assembly.

Has anyone else found this problem, and if so, what was done to fix the issue?

Thanks!

Andrea
 
A

Andrea Williams

I'm not sure that I understand what you are trying to say here... could you elaborate? And what does Response, Request, etc have to do with inheritance? I'm a little lost on your train of thought...

Maybe wasn't clear in my explanation. The forms work properly, the values show up correctly when the page is viewed in the browser. The problem is in Visual Studio.Net 2003. When the code-behind inherits from a class in a different assembly, then the Forms designer errors with the message below. Is there some sort of special thing that I have to do or set to allow VS.NET to see the that the class in the separate assembly does inherit from System.Web.UI.Page? That seems to be the issue. I can inherit from code many layers deep if all the classes are in the same assembly, but when I inherit from a different assembly (but in the same solution and references are established), that's when VS.NET bombs.

Thanks!
Andrea
when your page is hosted by the designer, Response, Request, etc, are all null. you have to code for this case.

-- bruce (sqlwork.com)


I'm trying to add common functionality to each of my ASPX page, using inheritance from a project class out side my web class. When I do that, the Web Forms Designer does not load.

public class UserRegister : WebBaseClass

{

}

//In a different assembly



public class WebBaseClass : System.Web.UI.Page

{

}

Everything compiles and runs just fine, but the ASPX page doesn't show me the "Design" and "HTML" buttons at the bottom any more, and I get the following error when opening the ASPX file:

The file could not be loaded into the Web Forms Designer. Please correct the following error and then try loading it again:

An exception occurred while trying to create an instance of ASPCommon. The exception was "Culture name US-EN is not supported."

Parameter name: name".

Make sure all of the classes used in the page are built or referenced in the project.

I at first thought it was because I had the page's inheritance three levels deep, but now I've determined that it's because the class that inherits System.Web.UI.Page is not in the same assembly.

Has anyone else found this problem, and if so, what was done to fix the issue?

Thanks!

Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top