Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Strange Problem with class visibilityStrange Problem with class visibility
Previous
 
Next
New Post
6/3/2008 1:00 PM
 

I was trying to customize the management of users by creating a module. When I tried to inherit from

DotNetNuke.Modules.Admin.Users.ManageUsers

I noticed that the class is not listed in IntelliSense. Other classes in The same namespace (like BulkEmail, Profile etc.) were listed, but MandgeUsers, MemberServices, ViewProfile etc. were not listed.

I checked Object Browser, and same was the case there. I checked definition of each class, and found no difference regarding Visibility specifiers.Each class was declared as:

Partial Class ClassName

There was nothing related to Public or Friend constructors even.

Can somebody explain this strange behaviour???

 
New Post
6/3/2008 6:46 PM
 

manageusers is the partial class inherited by manageusers.ascx.vb i.e. it's an ascx control. It's not designed to be inherited from, if you want to work with it use LoadControl.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/4/2008 1:19 AM
 

But then, Membership, Password, User etc. are also partial classes inherited by their respective ascx controls.

My question is why is that Membership & Password are available for inheritance & even object creation via New operator, but ManageUsers is available for none, when there is no difference with visibility, etc. of these partial classes???

 
New Post
6/4/2008 8:04 AM
 

at a guess i would say it's because manageuser is both subclassed and implements an interface - i really haven't looked into it, as whilst it's possible to subclass ascx.vb it's typically not the route you want to go - ascx's are intended to have a visual layer that then loads and processes related code-behind code - instantiating the code-behind directly breaks this relationship and you're likely to have problems e.g. you'll see designer failuires in vs.net etc.

In theory we should mark these classes as Sealed to stop people trying to subclass their *.vb code but realistically no-one ever tries to do this (some discussion of this can be seen @ http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/230477/scope/posts/Default.aspx)

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/4/2008 10:36 AM
Accepted Answer 

Ok, I found the reason for that behaviour.

Only those controls' code-behind classes were available for sub-classing or creating an object, which were either referenced (<% Reference %>) or Registered (<% Register %>) in the markup for your control!!!

And that appears obvious now. As ASP.NET documentation says, these tags lead another ASP.NET page or control to be compiled with the current one. Thanx for taking time to reply!!!

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Strange Problem with class visibilityStrange Problem with class visibility


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out