473,806 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inherits class in webpage

Hello,

I created a VB class that inhertis from System.Web.UI.P age. 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.P age. 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 1292
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******** ******@TK2MSFTN GP09.phx.gbl...
Hello,

I created a VB class that inhertis from System.Web.UI.P age. 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.P age. 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******** ******@TK2MSFTN GP09.phx.gbl...
Hello,

I created a VB class that inhertis from System.Web.UI.P age. 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.P age. 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
2069
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 with potential to be useful, but I would like to hear more opinions first. If this is deemed to be useful, I *may* try to write a PEP for it. This is not a promise or even a proposal, at this point. Broadly generalizing, classes in Python have...
1
6703
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 shine
4
7192
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 name for the page that will be dynamically compiled automatically when the page is requested. This value can be any valid class name but should not include a namespace. So this is what will decidw what gets compiled? Then what is the point of...
1
993
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
1732
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
2162
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 .aspx.vb file in the original directory, but cannot do so with the Inherits property. I know one solution is to place the DLL file in the new directory with my .aspx file, but I would like to avoid this as it would require me to update all the...
2
1378
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 or C can be passed to it. 4. In this function, I need to determine whether the object passed to it inherits A or not.
2
4742
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 class user contains 3 constructor named 1. Public sub new() 2. Public SUb New(ByVal sName as string) 3. Public SUb New(ByVal sName as string, Byval sPassword as string)
1
1467
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 Public Class Constr : Inherits Page Public Sub New()
0
9718
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, 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...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
jinu1996
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...
1
10370
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
agi2029
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...
1
7649
isladogs
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...
0
6876
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();...
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
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...

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.