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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesNavigate from a Modulecontrol to anotherNavigate from a Modulecontrol to another
Previous
 
Next
New Post
2/18/2013 4:44 AM
 

Hi all

I have a problem. I can't navigate from a ModulControl to another. I develop with Dotnetnuke 6.2.5 and I use a template for development.

I added in the Extionsion Settings the Modulcontrol only with the key "newView". Everytime I click the link, I see only a blank page.

I hope someone can help me.

Here is the Code:

View.ascx

<%@ Control language="C#" Inherits="xxx.View" AutoEventWireup="false"  Codebehind="View.ascx.cs" %>

<p>Hello</p>

<asp:HyperLink runat="server" id="hlnk">test</asp:HyperLink>

View.ascx.cs

public partial class View : cQuizModuleBase, IActionable
    {

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);
        }

        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                hlnk.NavigateUrl = Globals.NavigateURL("newView");
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }        

        public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(GetNextActionID(), Localization.GetString("EditModule", this.LocalResourceFile), "", "", "", EditUrl(), false, SecurityAccessLevel.Edit, true, false);
                return Actions;
            }
        }
    }

View2.ascx

<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="View2.ascx.cs" Inherits="xxx.View2" %>
<p>World</p>

View2.ascx.cs

public partial class View2 : cQuizModuleBase
    {

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);
        }

        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
    }

 
New Post
2/18/2013 7:16 AM
 
what is the URL you see when you click the link? Also, how did you register the control exactly. Finally.. do you see any errors in the event log?

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
2/18/2013 7:31 AM
 

Although one would think that the form of Globals.NavigateUrl you are using would work, it is actually necessary to include the ModuleId in the query string. Either of the following should work:

hlnk.NavigateUrl = Globals.NavigateURL("newView", new string[] { "mid=" + ModuleId.ToString() });

or

hlnk.NavigateUrl = EditUrl("newView");         // EditUrl includes code to add the mid parameter and value to the querystring for you


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesNavigate from a Modulecontrol to anotherNavigate from a Modulecontrol to another


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