Here are several methods which can be used to navigate between controls within a DotNetNuke module.
#region Navigation Methods
/// <summary>
/// Redirects to module view.
/// </summary>
protected virtual void RedirectToModuleView()
{
Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true);
}
/// <summary>
/// Gets the module control URL.
/// </summary>
/// <param name="controlName">Name of the control.</param>
/// <returns></returns>
protected virtual string GetModuleControlUrl(Enum controlName)
{
string[] param = new string[2];
param[0] = MODULE_ID_KEY;
param[1] = ModuleId.ToString();
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param);
}
/// <summary>
/// Gets the module control URL.
/// </summary>
/// <param name="controlName">Name of the control.</param>
/// <param name="parameterName">Name of the parameter.</param>
/// <param name="parameterValue">The parameter value.</param>
/// <returns></returns>
protected virtual string GetModuleControlUrl(Enum controlName, string parameterName, int parameterValue)
{
return GetModuleControlUrl(controlName, parameterName, parameterValue.ToString());
}
/// <summary>
/// Gets the module control URL.
/// </summary>
/// <param name="controlName">Name of the control.</param>
/// <param name="parameterName">Name of the parameter.</param>
/// <param name="parameterValue">The parameter value.</param>
/// <returns></returns>
protected virtual string GetModuleControlUrl(Enum controlName, string parameterName, string parameterValue)
{
string[] param = new string[4];
param[0] = MODULE_ID_KEY;
param[1] = ModuleId.ToString();
param[2] = parameterName;
param[3] = parameterValue;
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param);
}
/// <summary>
/// Gets the module control URL.
/// </summary>
/// <param name="controlName">Name of the control.</param>
/// <param name="parameters">The parameters.</param>
/// <returns></returns>
protected virtual string GetModuleControlUrl(Enum controlName, string[] parameters)
{
List<string> param = new List<string>();
param.Add(MODULE_ID_KEY);
param.Add(ModuleId.ToString());
param.AddRange(parameters);
return DotNetNuke.Common.Globals.NavigateURL(TabId, controlName.ToString(), param.ToArray());
}
#endregion