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.0Hosting ASPX Pages in DNNHosting ASPX Pages in DNN
Previous
 
Next
New Post
10/25/2006 4:26 PM
 
Can ASPX pages be hosted in DNN if it inherits from the DNN BasePage class? 

If yes:

1) Will these pages be secured using DNN infrastructure or does that require custom code?

2) Can one use the DNN menu and other controls on these ASPX pages so the look/feel is same as module-based pages?

 
New Post
10/28/2006 11:40 PM
 

I think you can do that, but why wouldn't you simply create a module and skip all the extra coding?

To create a module you need:

1. an XML template file with a .dnn extension

2. a web control

3. Zip it and upload it as a module to your dotnetnuke site.

I was trying to figure out the same thing, then I found the site http://www.dnnwiki.net.  This is for creating c# modules, but it's very simple.  Download the WhoAreYou.zip file to look at these files.  This guy did an AMAZING job.

Example whoareyou.dnn

<dotnetnuke version="3.0" type="Module">
  <folders>
    <folder>
      <name>WhoAreYou</name>
      <description>Says who is logged in and which Security Roles they belong</description>
      <version>01.01.01</version>
      <modules>
        <module>
          <friendlyname>Who Is Logged in Module</friendlyname>
          <controls>
            <control>
              <title>View WhoAreYou</title>
              <src>WhoAreYou.ascx</src>
              <type>View</type>
            </control>
          </controls>
        </module>
      </modules>
      <files>
        <file>
          <name>WhoAreYou.ascx</name>
        </file>
        <file>
          <name>WhoAreYou.ascx.cs</name>
        </file>
      </files>
    </folder>
  </folders>
</dotnetnuke>

Example WhoAreYou.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WhoAreYou.ascx.cs" Inherits="WhoAreYou" %><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

Example WhoAreYou.ascx.cs

public partial class WhoAreYou : DotNetNuke.Entities.Modules.PortalModuleBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DotNetNuke.Entities.Users.OnlineUserInfo mRoles = new DotNetNuke.Entities.Users.OnlineUserInfo();
            DotNetNuke.Security.Roles.RoleController mUserRoles = new DotNetNuke.Security.Roles.RoleController();
            DotNetNuke.Entities.Users.UserInfo mUser = new DotNetNuke.Entities.Users.UserInfo();
            mUser = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo();
           
            string showRoles = "";
           
            foreach (string i in mUserRoles.GetRolesByUser(mUser.UserID, mRoles.PortalID))
            {
                showRoles += i.ToString() + ", ";
            }
           
            Label1.Text = "Logged in as: " + mUser.Username + "<br>Roles: " + showRoles.ToString();
        }
        catch (Exception err)
        {
            Label1.Text = "Note: User info failed";
        }

    }
}

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Hosting ASPX Pages in DNNHosting ASPX Pages in DNN


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