Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Affordable ASP.NET Hosting Service
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Why are we using abstract/MustInherit in .ascx controls ?
Previous Previous
 
Next Next
New Post 5/27/2008 6:38 AM
User is offline Jaydeep Bhatt
81 posts
www.vision-consultants.com
10th Ranked


Why are we using abstract/MustInherit in .ascx controls ? 

I am wondering what is the reason, that the .ascx Controls classes, that we use in DNN Modules are declared MustInehrit / abstract

What is the pros/cons of removing this modifier ?


bhattji

Vision is the ability to see the Invisible
 
New Post 5/27/2008 8:04 AM
User is offline Charles Nurse
2902 posts
5th Ranked










Re: Why are we using abstract/MustInherit in .ascx controls ? 

This is primarily a hold-over from the DNN 3/ASP.NET 1.1 days.

IMO - there are no cons in removing the Abstract/MustInherit modifier.  But there are not really any pros either.

Theoretically - removing the modifier removes the ability to "instantiate" the class declared in the "code-behind".  That is all.  In reality there are very few (if not no)  reasons why you would instantiate the code behind class - and not want the inherited "ascx" version of the class.  Remember that the ascx "inherits" or sub-classes the code behind, so if you instantiated the code behind directly you would get none of the html layout of the control - just the code aspects.

In DNN4/ASP.NET 2, we use the code-beside model a lot - if you use that model the code file is declared as a Partial class and is combined with the ascx file - rather than the ascx file inheriting from the code file.


Charles Nurse
DotNetNuke Trustee,
Senior Architect, DotNetNuke Coporation
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
See my Blog for Articles on .NET, DNN and Module Development

View my Blog
 
New Post 5/27/2008 8:26 AM
User is offline Brian Dukes
477 posts
www.engagesoftware.com
8th Ranked


Re: Why are we using abstract/MustInherit in .ascx controls ? 

Isn't the partial class just between the codebehind and the designer file (Pagename.ascx.vb and Pagename.ascx.designer.vb)?  The ascx files I see are still using an Inherits attribute.  I still can't get at code that is declared internal from my ascx.  Am I misunderstanding what's going on there?

Thanks,


Brian Dukes
Engage Software
St. Louis, MO
314.966.4000

The leading provider of DotNetNuke support, training and custom module development.
 
New Post 5/27/2008 8:39 AM
User is offline Charles Nurse
2902 posts
5th Ranked










Re: Why are we using abstract/MustInherit in .ascx controls ? 

Brian

You might be right - I was basing my comments on what I had heard on podcasts like Dot net Rocks.  I haven't actually looked into that aspect.


Charles Nurse
DotNetNuke Trustee,
Senior Architect, DotNetNuke Coporation
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
See my Blog for Articles on .NET, DNN and Module Development

View my Blog
 
New Post 5/28/2008 2:57 AM
User is offline Jaydeep Bhatt
81 posts
www.vision-consultants.com
10th Ranked


Re: Why are we using abstract/MustInherit in .ascx controls ? 

Right, so I guess, it is safe to declare the class as abstract/MustInherit, right ?

What I would like to know is, should I add MyBase.Load and Me.Load, both to the Page_Load event handler ?


bhattji

Vision is the ability to see the Invisible
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Why are we using abstract/MustInherit in .ascx controls ?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


telerik
telerik r.a.d.controls suite is the most innovative and comprehensive toolset for ASP.NET development, tailored for seamless integration with the DotNetNuke project. This integrated collection of controls allows professionals to build web-solutions with the UI richness and responsiveness of desktop applications.
dnn.telerik.com
CrystalTech
CrystalTech Web Hosting™ provides first-class service and support. Our value-packed ASP.NET plans offer DNN installation, SQL 2005 and up to 100 domain names starting at only $16.95 per month!
CrystalTech.com
DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP