473,545 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

inheriting code behind in a web form

Can I inherit from a web form?

I would like to reuse procedures in a web form base class code behind by
inheriting from it.

For example, I would like to have a HandleError function defined in the base
class code behind, which would then be available to any web forms code
behind which inherited the base web form code behind.

Is this supported? I can't find a way to do it.

Thanks!
Bill


Oct 4 '06 #1
1 1559
Sure. If you create a base page class, you don't have to create a full page
by the way, only a base class that inherits from System.Web.UI.P age. You
have to ensure though that the method is not marked private as then it won't
inherit.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"BillE" <be****@datamti .comwrote in message
news:eL******** *******@TK2MSFT NGP06.phx.gbl.. .
Can I inherit from a web form?

I would like to reuse procedures in a web form base class code behind by
inheriting from it.

For example, I would like to have a HandleError function defined in the
base
class code behind, which would then be available to any web forms code
behind which inherited the base web form code behind.

Is this supported? I can't find a way to do it.

Thanks!
Bill


Oct 4 '06 #2

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

Similar topics

1
1856
by: richardlane | last post by:
Hi, basic question here - I'm struggling with the transfer from asp to asp.net a bit, especially in seeing the 'bigger picture' of how things are best structured. I have a website made up primarily of aspx pages. I have separated out the common <head> as an .ascx file and intend to do the same for other common regions of html. In the...
1
1098
by: Andy Breward | last post by:
Hi I have created a base web form that all other pages inherit from which is really nice as all my session and seurity stuff goes in here and works well. My issue is with the source code that the IDE creates, this function: - override protected void OnInit(EventArgs e)
9
1553
by: Ryan Ternier | last post by:
I just got moved to a project that has an inheritance structure sort of like this: MyWebPage.aspx inherits ---> MyWebPage.ASPX.VB inherits ----> Utility.VB inherits -----> DHTMLMenu.vb inherits ----> System.WEb.UI.Page Whenever I load up my aspx page, i get an error because it can't find the
2
1821
by: Simon | last post by:
Hi, Just to get started.... I've created a very simple web form, "Simple", using VS and I dropped a HTML img control on the design view. I referenced a picture and it is displayed in browser view. Very simple. I have created a second form and in the code-behind page I have altered the class definition to inherit from, "Simple".
3
1168
by: YYZ | last post by:
I'm new to VB.net, but not new to OO in general, and I'm very strong in VB6. However, I don't know what I did in VB.net to cause this to happen. I've got 2 projects open at the same time, in the same solution. One is a Class Library project that contains 1 form and 1 class. The other project is a normal Windows app, and contains 2 forms,...
4
1180
by: elziko | last post by:
I would like to do the following: Create a class that inherits from a usercontrol. Then add a control to the designer Call this new class ClassA. Many controls I need will start off like this so I'd like to create all controls form now on from this base control. So, for example, I inherit from this base control and add the further...
7
4949
by: Vish | last post by:
Hi, I have a base form from which i want all of my forms to inherit from. The base form has three buttons anchored to the bottom right of the base form. When i first inherit a new form from the base form everything seems to be fine. The 3 buttons from the base form show up on the bottom right of the inherited form. But as i started adding...
2
4805
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be required: <%@ Register TagPrefix="UC" TagName="MyUserCtrl" Src="MyUC.ascx" %> Assuming that the ASPX page doesn't use a code-behind, I can access the...
0
903
by: ashtek | last post by:
Hi, I have two (almost similar) web pages Page1 & Page2. Both of them have a datagrid and databinding is done during runtime by executing different stored procedures for each page. Datagrid has customized paging. Also, Page1's datagrid has 10 columns while Page2's datagrid has only 7 columns. So, in Page1, I check for the current page...
0
7465
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...
1
7416
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...
0
7752
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 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...
1
5325
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...
0
4944
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...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
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
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.