Guys,
I found a way of how to do it. Following steps are required to make it work for every user control (.ascx) that you add to your module.
1. By default a user control is inherited from " System.Web.UI.UserControl" class. you need to change its definition by inheriting it from a DotNetNuke class, e.g. if a user control name is Category, it will be defined like this
From: public partial class Category : System.Web.UI.UserControl
To: public partial class Category : PortalModuleBase, IActionable
where "PortalModuleBase" is a DotNetNuke class defined under "DotNetNuke.Entities.Modules" namespace and "IActionable" is an interface defined under same namespace.
2. Then provide an implementation for "IActionable" interface as follows.
#region
Optional Interfaces/// -----------------------------------------------------------------------------
/// <summary>
/// Registers the module actions required for interfacing with the portal framework
/// </summary>
/// <value></value>
/// <returns></returns>
/// <remarks></remarks>
/// <history>
/// </history>
/// -----------------------------------------------------------------------------
{
public ModuleActionCollection ModuleActionsget
{
Actions.Add(
}
}
3. Then compile and run your application. Login with "Host" account, go to Host Menu, select "Module Definitions" under it. Then select your module in which you have added this new user control.
4. Add a definition for control and provide it a key name "Category".
5. Now you can navigate to this control from any other control in your module using this code.
Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Category", "mid=" + ModuleId.ToString()));
Enjoy :)
Thanks,
Syed Danish.
ModuleActionCollection Actions = new ModuleActionCollection();this.GetNextActionID(), Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", this.EditUrl(), false, SecurityAccessLevel.Edit, true, false);return Actions;