Hi!
I have a abstract base class that derives from System.Web.UI.P age. In this
class I have some abstract methods.
My other web pages should derive from this class and implement the abstract
methods. When I try to display the derived web page in the designer I get an
error:
" The file could not be loaded into the Web Forms designer. Please correct
the following error and then try loading it again:
Type Abstract
Make sure...."
It seams that a web page can not derive from a abstract class, is it really
so?
Thanks in advance.
/Henke 4 1320
> It seams that a web page can not derive from a abstract class, is it
really so?
Yes and no :-)
It can descend from the abstract class, but the designer always creates an
instance of the parent class (which is abstract). You can design your pages
using HTML but not the WYSIWYG designer.
Instead of making your page abstract you could implement the abstract
methods and just throw an exception. Although unimplemented "abstract"
methods will then surface at runtime rather than compile time, so you may
not want to do this. Personally, I'd stick to the HTML editor anyway (and
do).
--
Pete
====
Audio compression components, DIB graphics controls, FastStrings http://www.droopyeyes.com
Read or write articles on just about anything http://www.HowToDoThings.com
Ok, that answers my question anyway, but I think it's quite odd though...
Thanks!
/Henke
"Peter Morris" <pe**@removethi sbit.droopyeyes .com> skrev i meddelandet
news:eG******** ******@TK2MSFTN GP11.phx.gbl... It seams that a web page can not derive from a abstract class, is it really so?
Yes and no :-)
It can descend from the abstract class, but the designer always creates an instance of the parent class (which is abstract). You can design your
pages using HTML but not the WYSIWYG designer.
Instead of making your page abstract you could implement the abstract methods and just throw an exception. Although unimplemented "abstract" methods will then surface at runtime rather than compile time, so you may not want to do this. Personally, I'd stick to the HTML editor anyway (and do).
-- Pete ==== Audio compression components, DIB graphics controls, FastStrings http://www.droopyeyes.com
Read or write articles on just about anything http://www.HowToDoThings.com
> Ok, that answers my question anyway, but I think it's quite odd though...
Well, it makes sense if you think about it. To represent a page the page
the designer must start from something which is compiled and then decorate
it with your additional HTML. It can't compile each time because whenever
you had an error in your code behind you wouldn't be able to design your
page. So, it shows the most recent ancestor class to ensure everything
looks the way it should before decorating, unfortunately your ancestor class
is abstract.
--
Pete
====
Audio compression components, DIB graphics controls, FastStrings http://www.droopyeyes.com
Read or write articles on just about anything http://www.HowToDoThings.com
The good news is, it is working in VS2005 beta 1 with no problem - not
that it solves today's problems, but something to look forward to.
--
Scott http://www.OdeToCode.com
On Fri, 13 Aug 2004 12:20:18 +0100, "Peter Morris"
<pe**@removethi sbit.droopyeyes .com> wrote: Ok, that answers my question anyway, but I think it's quite odd though...
Well, it makes sense if you think about it. To represent a page the page the designer must start from something which is compiled and then decorate it with your additional HTML. It can't compile each time because whenever you had an error in your code behind you wouldn't be able to design your page. So, it shows the most recent ancestor class to ensure everything looks the way it should before decorating, unfortunately your ancestor class is abstract. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Quentin |
last post by:
Dear Gurus,
This is a fairly simple question, but I can't figure out what the answer is.
I can easily change my code, but I want to know why I can't do this to
further my knowledge of the C++ language (and OO):
class a
{
public:
a(){ vm(); }
|
by: Zheng Da |
last post by:
I don't know where should I ask the question, so send the email to this
group.
I choose this group, because I want to write the program with c++ :)
I want to write a program which support multiprotocol, but do not want
to write code for all protocols which I want to support. I plan I give
a interface and others give a module which implements a protocol, and
then the module can be inserted into my program without recompiling my
program....
|
by: Marcin Kowalewski |
last post by:
Hi I've got a stupid problem with code below :
using System;
using System.Drawing;
....
public class CsrcImage :Image
{
public CsrcImage()
{
//
|
by: Richard Thomas |
last post by:
Hi,
I've got an .aspx page with a number of controls on it for setting the
values for an object. When the values have been put in, the user
clicks on the "Store" button.
When I want to edit an instance of this object, I've got a second page
which is a direct copy of the first, but some of the code has been
changed so that, for example, the Store button now says "Update".
|
by: Stephen Walch |
last post by:
Error C2392 is hitting me hard!
I have a managed C++ library that implements a bunch of fixed interfaces.
For example, one interface is:
public abstract interface IDbCommand
{
public abstract new System.Data.IDbConnection Connection
}
| |
by: Doug |
last post by:
I am trying to work with an object and create it like so:
EXTRA.Sessions oSessions = new EXTRA.Sessions();
This doesn't work because I get this error:
'Cannot create an instance of the abstract class or interface
'EXTRA.Sessions'.'
So I try to do this:
|
by: Murray Gill |
last post by:
Our current solution has a number of ASP.NET pages with very similar functionality. We would like to move the common functions into a base class that inherits from System.Web.UI.Page, and then force the child classes to override certain functions of that class.
The best way to do this is to define the base class as "MustInherit" and put "MustOverride" on the functions that must be overridden.
However, when we do this, whenever we...
|
by: craig |
last post by:
Given two existing but different classes OldA and OldB (that can not be
made to derive from any new base class); is there a way to make them
both "observer" objects so that they can be put in one central list and
updated thru a common interface. (i.e. observer->update( ..))?
Potential solution 1 (multiple inheritence): make a small new observer
class, and two new classes: NewA: derived from OldA, and Observer,..
and NewB: derived from...
|
by: Alexander Mueller |
last post by:
Owen Blacker schrieb:
Something that is static just exists once.
If you could override or derive it, you would create it for
a second time.
See it like this:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |