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...Using Modules a...Using Modules a...Module Control Not DisplayingModule Control Not Displaying
Previous
 
Next
New Post
1/7/2011 1:08 PM
 

Hi, I'm trying to add a new control to my Test module.  I have created a control in the Test module's folder called ConfirmQuery.acsx and the associated code behind files and added it to the VS project.

    public partial class ConfirmQuery : TestModuleBase, IActionable

 I have added the control to my Module's definitions with a key "ConfirmQuery" and View type. The source is not selectable in the drop down so I have manually entered it as:

                DesktopModules/Test/ConfirmQuery.acsx

I have set the Default Cache Time to 0 and executed the Updated Definition to ensure the cache is cleared.  Here's what the module definition looks like:

Module Controls

Control Title Source
DesktopModules/Test/View.ascx
ConfirmQuery Confirm Query DesktopModules/Test/ConfirmQuery.acsx
Edit Edit Content DesktopModules/Test/Edit.ascx
Settings Test Settings DesktopModules/Test/Settings.ascx

I have a command button on the view for the Test module that when pressed execute the code:

       Response.Redirect(Globals.NavigateURL("ConfirmQuery"), false);

When the command button is pressed the that code is hit but neither the ConfirmQuery's constructor or Page_Load method are executed.  The resulting display is a blank Test tab.

Any ideas?

 
New Post
1/7/2011 2:07 PM
 
If you can't see the ASCX file in your dropdown list then something is wrong. All ASCX files in the desktopmodules/test/ folder should show up. I would start by tracking that down, and fixing that will likely fix the issue of not loading the control on the page.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
1/7/2011 2:21 PM
 
Thanks Chris.  I had a hunch that was a problem.  I'm not sure what I need to do to make the acsx show up in the drop down list.  I have the files in the folder.  They're very simple.

Is there anything else I need to do to make a control other then create the files and add it to the project?

As you can see in my previous post entered the source path similar to what is in the drop down.

I'm not sure how to attach files so I'll just list the code here.

ConfirmQuery.ascx:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConfirmQuery.aspx.cs" Inherits="com.bsgsystems.DNN.Test.QueryConfirm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    CONFIRM CONFIRM CONFIRM
    
    <p>
     XXXXXX
    </p>
 
     </div>
    </form>
</body>
</html>



ConfirmQuery.ascx.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Localization;
using DotNetNuke.Security;

namespace com.bsgsystems.DNN.Test
{
    public partial class ConfirmQuery : TestModuleBase
    {

        ConfirmQuery()
        {
            int x = 0;
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

    }
}


ConfirmQuery.ascx,designer.cs:

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace com.bsgsystems.DNN.Test {
    
    
    public partial class QueryConfirm {
        
        /// <summary>
        /// form1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlForm form1;
    }
}
 
New Post
1/7/2011 2:34 PM
 
Chis, I found 1 problem and corrected it.  I had the files named .aspx instead of .ascx and changed the Page control to:

<%@ Control language="C#" Inherits="com.bsgsystems.DNN.Test.ConfirmQuery" AutoEventWireup="true"  Codebehind="ConfirmQuery.ascx.cs" %>

The control source shows up in the drop down.  I updated the module and cache but it still doesn't display.
 
New Post
1/7/2011 3:06 PM
 

Just as a sanity check I looked at the redirect URL.

String url = Globals.NavigateURL("ConfirmQuery");
Response.Redirect(url);


URL: "http://localhost/dnndev/Test/tabid/61/ctl/ConfirmQuery/Default.aspx"

I'm not sure where the Default.aspx is coming from.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Module Control Not DisplayingModule Control Not Displaying


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