Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 November 19th, 2005, 11:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default VS changes Inherits automatically in ASP.NET

When working with VS together with ASP.NET there is some interaction between the .aspx file and the code-behind. The class of the Page_Load method normally inherits from the the Page class, but I have put another class in between.
Code:
Class1 : Class2 : Page
My Page_Load method is in Class1. The problem is that VS keeps changing the Inherits attribute in the .aspx file to Class2. How can I prevent this behaviour? It is driving me crazy... that is, more crazy than currently.

Thanks, Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old December 1st, 2005, 02:39 PM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

C# doesnt allow multiple inheritance. didnt your page give a compile error?

Regards
Ganesh
 
Old December 1st, 2005, 04:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am quite aware that you cannot do multiple inherritence by specifying something like this...
Code:
public class MyClass : Base01, Base02, Base03
... as in other languages, but it is possible to do a chain of inherritence, which was what I tried to describe using my psudo notation.

Therefore, I have this chain of inherritence, and VS.NET keeps changing the value of the attribute on the aspx page telling which code-behind class to inherrit. I have solved the problem by making the aspx page readonly. It patches the problem, but I guess it doesn't solve it.

Thanks anyway,
Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing .doc file in asp automatically vishalres Classic ASP Professional 3 April 9th, 2007 05:56 PM
send email automatically with classic asp crmpicco Classic ASP Professional 6 July 4th, 2006 09:56 AM
select generated automatically with asp crmpicco Classic ASP Basics 1 July 7th, 2005 04:34 PM
Let ASP to be instlled automatically shailu Classic ASP Basics 0 July 5th, 2005 07:08 AM
ASP: automatically sending email report luxx Classic ASP Databases 1 January 12th, 2004 04:50 AM





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