Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 May 14th, 2004, 12:58 PM
Authorized User
 
Join Date: Mar 2004
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inheritance

Is it possible to inherit from a base class and still add additional functionality to a web form?

I have a web form (InheritanceDemo.aspx) that inherits from my base class. I then wanted to add some additional functionality and controls not referenced in my base class but the compiler didn't like that.

I guess I essentially want two code behind files. One that InheritanceDemo can inherit from (SimpleCodeBehind.vb) and then one to handle the additional code-behind operations - InheritanceDemo.aspx.vb
 
Old May 15th, 2004, 04:07 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't think you can use two separate code behind files, if that's what you mean with inherit.

However, you could create a new class that inherits from Page, and then your class can inherit from that new page. Note this is true inheritance, not a shared code behind file.

For some ideas, look here:
http://www.wilsondotnet.com/Demos/Generator.aspx
http://www.devx.com/dotnet/Article/18011/1954?pf=true
http://www.asp.net/Forums/ShowPost.a...=1&PostID=4692

(The last link is a really really long post on ASP.NET. Only read if when you have too much free time.... ;))

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Inheritance magagulad Visual Basic 2005 Basics 1 May 12th, 2008 07:51 AM
Inheritance michaelcode ASP.NET 2.0 Basics 5 September 26th, 2006 01:40 PM
Inheritance abhi_bth ASP.NET 1.0 and 1.1 Basics 0 September 23rd, 2006 10:03 AM
Need help with inheritance filip BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 August 25th, 2006 09:38 PM
c# inheritance bhohman C# 2 March 26th, 2004 01:47 PM





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