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

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...CodeFile and CodeBehind differenceCodeFile and CodeBehind difference
Previous
 
Next
New Post
4/19/2008 12:22 PM
 

Could someone please tell me the difference between CodeFile= and CodeBehind= in an .ascx file? VB puts a CodeFile in by default and I noticed that some of the controls in the core, like admin/skins/Login.ascx use it. However, when I try to use it in my ascx skin file I get an error message:

Could Not Load Skin: /Portals/_default//skins/test_skin1/skinwebusercontrol.ascx Error: The file '/DotNetNuke/admin/Skins/skin.vb' does not exist.

When I change my CodeFile= to CodeBehind= everything works just fine.

What's the difference? Thx.

 
New Post
4/19/2008 3:38 PM
 

The "CodeBehind" is a legacy attribute from ASP 1.1. "CodeFile" replaced it in ASP 2.0.

This is probably your culprit code: <%@ Control language="vb" CodeBehind="~/admin/Skins/skin.vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>

While I don't know the exact reason, I suspect it has to do with the way the "skin.vb" module is coded. "CodeFile" should point to a module that resolves the "DotNetNuke.UI.Skins.Skin" partial class.  The "skin.vb" module is probably not coded in a ASP 2.0 way that resolves that class.

That's not really an answer, but I hope it helps.

 

 
New Post
4/19/2008 10:22 PM
 

Thanks for that historical reference clarification. I've been stuck in a major Classic ASP project for years and am now jumping into ASP.NET deeply for the first time. Yes, the line that causes the error is:

<%

@ Control Language="VB" AutoEventWireup="false" CodeFile="~/admin/Skins/skin.vb" Inherits="DotNetNuke.UI.Skins.Skin" %>

So, I gather from what you say that if they recoded skin.vb for ASP 2.0 this problem would go away. In the Install package, there is no actual module in admin/Skins called skin.vb; it exists only in the source package and is the only .vb module there that is not an .ascx.vb file. I had a quick look at the source for skin.vb but don't yet know enough about the differences between ASP 1.1 and ASP 2.0 coding to see evidence of what you are talking about. However, it does sound plausible.

If that is the problem, is that not a bug? Should we report it?

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...CodeFile and CodeBehind differenceCodeFile and CodeBehind difference


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