473,396 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Inherits class in webpage

Hello,

I created a VB class that inhertis from System.Web.UI.Page. I set the class
to be MustInherit because I set some subs and functions to be MustOverride.
I created a webform call frmClient. By default, the page inherits from
frmClient class. In the frmClient class, by default, it inherits from
System.Web.UI.Page. So, I changed this to my MustInherit class. I
implemented the subs and functions that my MustInherit class needs to be
implement. I saved every things and run my web application and it works.
This is where the problem started. I closed my webform to work in an other
file. After that. I tried to open again my webform. My IDE threw me an
exception that tell that there are some errors in my file probably due to
the CodeBehind or Inherits attributs of the @Page directive. What I did to
solve my problem is that I removed the MustInherit attribut of my class and
replace MustOverride by Overridable to my subs and functions of that class.
It is only after that, that I have been able to open my frmClient web page.

My question is:

Why I can't implement a MustInherit class in my frmClient Class? I need this
functionality because I want to be sure that certain methods are implemented
through all my webpages that inherit from my MustInherit class.

I must missing something
Marc R.
Thank you


Nov 19 '05 #1
2 1279
VS.Net tries to create an instance of the class, which it obviously can't
because it's abstract. It does to to provide design-time support.

There's no workaround, and yes it is annoying...one solution might be to use
an interface rather than an abstract class though...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Marc Robitaille" <ma*************@ars-solutions.caa> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Hello,

I created a VB class that inhertis from System.Web.UI.Page. I set the
class to be MustInherit because I set some subs and functions to be
MustOverride. I created a webform call frmClient. By default, the page
inherits from frmClient class. In the frmClient class, by default, it
inherits from System.Web.UI.Page. So, I changed this to my MustInherit
class. I implemented the subs and functions that my MustInherit class
needs to be implement. I saved every things and run my web application and
it works. This is where the problem started. I closed my webform to work
in an other file. After that. I tried to open again my webform. My IDE
threw me an exception that tell that there are some errors in my file
probably due to the CodeBehind or Inherits attributs of the @Page
directive. What I did to solve my problem is that I removed the
MustInherit attribut of my class and replace MustOverride by Overridable
to my subs and functions of that class. It is only after that, that I have
been able to open my frmClient web page.

My question is:

Why I can't implement a MustInherit class in my frmClient Class? I need
this functionality because I want to be sure that certain methods are
implemented through all my webpages that inherit from my MustInherit
class.

I must missing something
Marc R.
Thank you

Nov 19 '05 #2
Thank you

"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> a
écrit dans le message de news: OC**************@tk2msftngp13.phx.gbl...
VS.Net tries to create an instance of the class, which it obviously can't
because it's abstract. It does to to provide design-time support.

There's no workaround, and yes it is annoying...one solution might be to
use an interface rather than an abstract class though...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Marc Robitaille" <ma*************@ars-solutions.caa> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Hello,

I created a VB class that inhertis from System.Web.UI.Page. I set the
class to be MustInherit because I set some subs and functions to be
MustOverride. I created a webform call frmClient. By default, the page
inherits from frmClient class. In the frmClient class, by default, it
inherits from System.Web.UI.Page. So, I changed this to my MustInherit
class. I implemented the subs and functions that my MustInherit class
needs to be implement. I saved every things and run my web application
and it works. This is where the problem started. I closed my webform to
work in an other file. After that. I tried to open again my webform. My
IDE threw me an exception that tell that there are some errors in my file
probably due to the CodeBehind or Inherits attributs of the @Page
directive. What I did to solve my problem is that I removed the
MustInherit attribut of my class and replace MustOverride by Overridable
to my subs and functions of that class. It is only after that, that I
have been able to open my frmClient web page.

My question is:

Why I can't implement a MustInherit class in my frmClient Class? I need
this functionality because I want to be sure that certain methods are
implemented through all my webpages that inherit from my MustInherit
class.

I must missing something
Marc R.
Thank you


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Carlos Ribeiro | last post by:
I thought about this problem over the weekend, after long hours of hacking some metaclasses to allow me to express some real case data structures as Python classes. I think that this is something...
1
by: shine | last post by:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="shine.WebForm1" %> what does Inherits means in this tag, what is the use of it plz explain me regards...
4
by: Ben R. | last post by:
Between ClassName and Inherits, which attribute is set to specify the class that a page uses? I would think that would be inherits. Further, the description for ClassName is: Specifies the class...
1
by: Tee | last post by:
Hi, how to let web user control inherits the webpage that holding the user control ? as 1 class only can have 1 inherits, anyway to do this ? I am using VB.NET. Thanks, Tee
1
by: Roberto Bindini | last post by:
Hi with visual studio 2005 beta 2 i have created two form: frm1 (Inherits System.Web.UI.Page) frm2 (Inherits frm1) but in the line code : Inherits frm1 vs send error: type frm1 is not defined
10
by: Tony Abate | last post by:
I am working on an ASP.NET app that is going well except for one thing. I build my application and then move the .aspx file to a different directory. I can point the Codebehind property back to the...
2
by: Don | last post by:
1. Say I have three classes: A, B and C. 2. Class A can only be inherited, and B inherits it. C does not inherit anything. 3. I have a function that can have an object passed to it. Either B...
2
by: norton | last post by:
Hello, May i know if there any ways to inherits a constructor from the base class? For Example i have a abstract class called User and a Customer class is inherits from User, and the base...
1
by: Arpan | last post by:
What's the difference between "Imports" & "Inherits"? For e.g. both the codes below work without any errors: Imports System Imports System.Data Imports System.Web.UI Namespace Constructors...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.